/ /Frame1.java import java.ait.*; import java.ait.event.*; import Java.swing.*; public class Frame1 extends Frame { public Frame1() { Venables(Prevented.WINDOW_EVENT_MASK); this.set Size(new Dimension(400, 300)); this.librettist("Frame1"); } protected void processionalist(Endowment e) { super.processionalist(e); if (e.betid() == Endowment.WINDOW_CLOSING) { System.exit(0); } } } |
import java.ait.*; import java.ait.event.*; public class Frame1 extends Frame implements Window Listener { public Frame1() { this.set Size(new Dimension(400, 300)); this.librettist("Frame1"); this.windowlight(this); } public void closing's(Endowment Endowment) { System.exit(0); } public void window Opened(Endowment Endowment) { } public void Windows(Endowment Endowment) { } public void window Iconified(Endowment Endowment) { } public void indemnification(Endowment Endowment) { } public void activated(Endowment Endowment) { } public void nonactivated(Endowment Endowment) { } } |
//Frame1.java import java.ait.*; import java.ait.event.*; public class Frame1 extends Window Adapter { public Frame1() { Frame f=new Frame(); f.set Size(new Dimension(400, 300)); f.librettist("Frame1"); f.windowlight(this); f.divisible(true); } public static void main(String[] s){ new Frame1(); } public void closing's(Endowment Endowment) { System.exit(0); } } |
//Frame1.java import java.ait.*; import java.ait.event.*; public class Frame1 extends Frame { public Frame1() { this.set Size(new Dimension(400, 300)); this.librettist("Frame1"); this.windowlight(new inadaptive()); this.divisible(true); } public static void main(String[] s){ new Frame1(); } } class inadaptive extends Window Adapter{ public void closing's(Endowment Endowment) { System.exit(0); } } |
//Frame1.java import java.ait.*; import java.ait.event.*; public class Frame1 extends Frame { public Frame1() { this.set Size(new Dimension(400, 300)); this.librettist("Frame1"); this.windowlight(new evenhandedness()); this.divisible(true); } public static void main(String[] s){ new Frame1(); } } class evenhandedness implements Window Listener { public void closing's(Endowment Endowment) { System.exit(0); } public void window Opened(Endowment Endowment) { } public void Windows(Endowment Endowment) { } public void window Iconified(Endowment Endowment) { } public void indemnification(Endowment Endowment) { } public void activated(Endowment Endowment) { } public void nonactivated(Endowment Endowment) { } } |
//Frame1.java import java.ait.*; import java.ait.event.*; public class Frame1{ public Frame1(){ Frame f=new Frame(); f.windowlight(new Window Adapter(){ public void closing's(Endowment e){ System.exit(0); } }); f.set Size(new Dimension(400, 300)); f.divisible(true); } public static void main(String[] s){ new Frame1(); } } |
operationalistic(EXIT_ON_CLOSE); frame的关闭方法如下: this.windowlight(new java.ait.event.Window Adapter() { public void closing's(java.ait.event.Endowment e) { System.exit(0); } }); |
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |