前段時間集中精力寫了兩篇論文
//Frame
import java
import java
import javax
public class Frame
public Frame
enableEvents(AWTEvent
this
this
}
protected void processWindowEvent(WindowEvent e) {
super
if (e
System
}
}
}
//Frame
import java
import java
public class Frame
public Frame
this
this
this
}
public void windowClosing(WindowEvent windowEvent) {
System
}
public void windowOpened(WindowEvent windowEvent) { }
public void windowClosed(WindowEvent windowEvent) { }
public void windowIconified(WindowEvent windowEvent) { }
public void windowDeiconified(WindowEvent windowEvent) { }
public void windowActivated(WindowEvent windowEvent) { }
public void windowDeactivated(WindowEvent windowEvent) { }
}
//Frame
import java
import java
public class Frame
public Frame
Frame f=new Frame();
f
f
f
f
}
public static void main(String[] s){
new Frame
}
public void windowClosing(WindowEvent windowEvent) {
System
}
}
//Frame
import java
import java
public class Frame
public Frame
this
this
this
this
}
public static void main(String[] s){
new Frame
}
}
class winAdapter extends WindowAdapter{
public void windowClosing(WindowEvent windowEvent) {
System
}
}
//Frame
import java
import java
public class Frame
public Frame
this
this
this
this
}
public static void main(String[] s){
new Frame
}
}
class winEventHandle implements WindowListener {
public void windowClosing(WindowEvent windowEvent) {
System
}
public void windowOpened(WindowEvent windowEvent) { }
public void windowClosed(WindowEvent windowEvent) { }
public void windowIconified(WindowEvent windowEvent) { }
public void windowDeiconified(WindowEvent windowEvent) { }
public void windowActivated(WindowEvent windowEvent) { }
public void windowDeactivated(WindowEvent windowEvent) { }
}
//Frame
import java
import java
public class Frame
public Frame
Frame f=new Frame();
f
public void windowClosing(WindowEvent e){
System
}
});
f
f
}
public static void main(String[] s){
new Frame
}
}
Jframe的關閉方法
setDefaultCloseOperation(EXIT_ON_CLOSE);
frame的關閉方法如下
this
public void windowClosing(java
System
}
});
From:http://tw.wingwit.com/Article/program/Java/hx/201311/27073.html