Đang chuẩn bị liên kết để tải về tài liệu:
Sams Teach Yourself Java 6 in 21 Days 5th phần 6

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Đầu ra của chương trình này phụ thuộc vào hai đối số quy định khi nó được chạy. Nếu bạn sử dụng 4 và 13, sản lượng sau đây được hiển thị: Ứng dụng này bao gồm hai lớp: Các WorldEnergy nguồn dữ liệu được kết hợp với một trình điều khiển Microsoft Access, theo hình 18,2. | Simpo PDF Merge and Split Unregistered VersionWttp ZZWWWeSimfpbpdf.cOm LISTING 12.3 The Full Text of FormatChooser.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 import java.awt. import java.awt.event. import javax.swing. public class FormatChooser extends JFrame implements ItemListener String formats choose format Atom RSS 0.92 R-SS 1.0 RSS 2.0 String descriptions Atom weblog and syndication format RSS syndication format 0.92 Netscape RSS RDF syndication format 1.0 RSS RDF RSS syndication format 2.0 UserLand JComboBox formatBox new JComboBox JLabel descriptionLabel new JLabel public FormatChooser super Syndication Format setSize 420 150 setDefaultCloseOperation JFrame.EXIT_ON_CLOSE setLayout new BorderLayout for int i 0 i formats.length i formatBox.addItem formats i formatBox.addItemListener this add BorderLayout.NORTH formatBox add BorderLayout.CENTER descriptionLabel setVisible true public void itemStateChanged ItemEvent event int choice formatBox.getSelectedIndex if choice 0 descriptionLabel.setText descriptions choice-1 public Insets getInsets return new Insets 50 10 10 10 public static void main String arguments FormatChooser fc new FormatChooser 12 This application extends the combo box example from Day 9 Working with Swing. Figure 12.3 shows this application. 344 SimpbVDFWrgeyndSp lit unregistered Version - http www.simpopdf.com FIGURE 12.3 The output of the Formatchooser application. The application creates a combo box from an array of strings and adds an item listener to the component lines 22-25 . Item events are received by the itemStateChanged TternEvent method lines 31-36 which changes the text of a label based on the index number of the selected item. Index 1 corresponds with Atom 2 with RSS 0.92 3 with RSS 1.0 and 4 with RSS 2.0 . Key Events Key events occur when a key is pressed on the keyboard. Any component can generate these events and a class must implement the

Đã 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.