Results 1 to 1 of 1
-
Demonstrating the WindowListener with a WindowAdapter
Java Code:import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import javax.swing.JFrame; public class WindowAdapterTest { public static void main(String args[]) { JFrame frame = new JFrame("Window Listener"); WindowListener listener = new WindowAdapter() { public void windowClosing(WindowEvent w) { System.exit(0); } }; frame.addWindowListener(listener); frame.setSize(300, 300); frame.show(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Demonstrating the WeakHashMap
By Java Tip in forum java.langReplies: 0Last Post: 04-12-2008, 08:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks