Java 7 教學手冊 第五版 作者:洪維恩著 旗標 書號:F2733
Chapter 17 AWT 視窗物件 ch17.7z
- app17_1.java
- app17_2.java (AWT example: Frame)
- app17_3.java ( extends Frame)
- app17_5.java (new Frame())
- app17_6.java (Frame + Label =>frm.add(lab))
- app17_7.java (set Location)
- app17_8.java (add Button)
- app17_10.java (CheckBox)
- app17_11.java ( CheckboxGroup)
- app17_12.java (TextField)
- app17_13.java (TextArea)
- app17_14.java (new BorderLayout, frm.setLayout(border))
- app17_15.java (new CardLayout, frm.setLayout(border))
- app17_16.java (new FlowLayout, frm.setLayout(border))
- app17_17.java (new GridLayout, frm.setLayout(border))
app17_17_jdwang2018_10_8.zip(GridLayout+Button Array)
-
How to close "Window" ?
import java.awt.event.*;
within the main() add the following "WindowListener".
frm.addWindowListener(
new WindowAdater() {
public void windowClosing(WIndowEvent e){
System.exit(0);
}
}
);