????Java ????????????????????????? Frame ?м??? Listner ??ɡ?
import java.awt.*;
import java.awt.event.*;
public class QFrame extends Frame {
public QFrame() {
this.setTitle("my application");
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
});
this.setBounds(10??10??200??200);
}
}
????????????????????????????????и?????????????????????????????
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
}
????new ???????? WindowAdapter ??????????? {} ???????????е????????????????????????????? Java ?????к?????????????塣
????????÷??????????????????????????????? override ?????????????
?????? WindowAdapter ?????????????????????????????? WindowListener ???????????
????Frame.addWindowListner(); ?????????? WindowListner ?????????????????WindowAdapter ?????????????????
????????????????????????????????????????????????й?????????????????????????????????????д???????????????????????????????????Щ?????????????????????? super ??????????????????????????????????????????????????漸???????
????1. ???????????????????????????????????????????????????????????????????Щ????????????? final ??
????2. ?????????????????????????????????????????й????????
????3. ??????????????????ó????????顣