Lecture Notes/Android Basics
Basic Framework : JAVA AWT Program
kingjung
2010. 6. 3. 20:57
import java.awt.*;
import java.awt.event.*;
public class AWTCaseFive extends Frame implements ActionListener {
public static final int WIDTH = 300;
public static final int HEIGHT = 200;
public AWTCaseFive() {
setTitle("AWT Case 5");
setSize(WIDTH, HEIGHT);
Button endButton = new Button("Click to End the Program");
endButton.addActionListener(this);
add(endButton);
setVisible(true);
}
public static void main(String[] args) {
new AWTCaseFive();
}
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}