Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Professional Java JDK 6 Edition 2007 phần 9
Đang chuẩn bị liên kết để tải về tài liệu:
Professional Java JDK 6 Edition 2007 phần 9
Tường Vi
54
77
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Tham khảo tài liệu 'professional java jdk 6 edition 2007 phần 9', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Part II A Broad Understanding of Java APIs Tools and Techniques cancelMI.setEnabled false initially disable the cancel menu item since there is no active request cancelMI.setEnabled false menu.add new MenuItem - menu.add new MenuItem Configure Zipcode .addActionListener new ActionListener . retrieve user input for zipcode field menu.add new MenuItem Exit .addActionListener new ActionListener public void actionPerformed ActionEvent evt System.exit O this.icon new TrayIcon wImage Weather Watcher menu sysTray.add this.icon . The actionPerformed method of the WeatherWatcher class is where weather Web Services requests are started. Because WeatherGetter.getWeatherAsync is called the request is non-blocking and starts up in a background thread. When the request terminates either successfully or fails with an exception the anonymous AsyncHandler GetWeatherResponse s handleResponse method is called called when user clicks Get Weather context menu item initiates asynchronous web service call public void actionPerformed ActionEvent evt this.getWeatherMI.setEnabled false cancelMI.setEnabled true future weatherGetter.getWeatherAsync zipcode new AsyncHandler GetWeatherResponse note that this reponse method is on another thread so we have to get back on the GUI thread to do any updates to our GUI components public void handleResponse Response GetWeatherResponse resp try final Weather w if resp.isCancelled resp.isDone if there was an exception during the web service processing it will be thrown here GetWeatherResponse gwr resp.get w gwr.getWeather else 592 Chapter 11 Communicating between Java Components and Other Platforms user cancelled the request re-enable menus and return try SwingUtilities.invokeAndWait new Runnable public void run cancelMI.setEnabled false getWeatherMI.setEnabled true catch Exception ex ex.printStackTrace return . All execution in handleResponse occurs on a different thread. This is extremely important it means whenever you want to update your GUI .
TÀI LIỆU LIÊN QUAN
Oracle Certified Professional Java SE 7 Programmer Exams 1Z0-804 and 1Z0-805
Professional C#Third Edition
Professional Silverlight 4
HandBooks Professional Java-C-Scrip-SQL part 1
HandBooks Professional Java-C-Scrip-SQL part 2
HandBooks Professional Java-C-Scrip-SQL part 3
HandBooks Professional Java-C-Scrip-SQL part 5
HandBooks Professional Java-C-Scrip-SQL part 6
HandBooks Professional Java-C-Scrip-SQL part 9
HandBooks Professional Java-C-Scrip-SQL part 11
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.