Đang chuẩn bị liên kết để tải về tài liệu:
Lập trình Java cơ bản : Các thành phần GUI part 5

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Nói Java compiler không compile ra machine code là không đúng. Thực chất file code Java sau khi đưa vào compiler sẽ được compile ra thành machine code dành cho cái máy này. Trên các platform thực, JRE sẽ emulate JVM để recompile toàn bộ bytecode thành native code của platform đó. Để cho các chương trình Java chạy trên nhiều platform khác nhau | Nút nhấn Button import java.applet.Applet import java.awt. import java.awt.event. public class DemoButton extends Applet implements ActionListener private Button blueButton private Button whiteButton private Button helloButton public void init blueButton new Button Blue whiteButton new Button White helloButton new Button Hello blueButton.addActionListener this whiteButton.addActionListener this helloButton.addActionListener this 25 Nút nhấn Button add blueButton add whiteButton add helloButton public void actionPerformed ActionEvent event . if event.getSource helloButton javax.swing.JOptionPane.showMessageDialog this Hello else if event.getSource blueButton this.setBackground Color.BLUE else if event.getSource whiteButton this.setBackground Color.WHITE repaint Nút nhấn Button .