home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-12-14 | 1.3 KB | 64 lines |
- import java.util.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.text.*;
-
- public class Windows1 extends Object implements WindowListener
- {
- public void windowOpened(WindowEvent e)
- {
- System.out.println("Window opened.");
- }
-
- public void windowClosing(WindowEvent e)
- {
- System.out.println("Window closing.");
- System.exit(0);
-
- }
-
- public void windowClosed(WindowEvent e)
- {
- System.out.println("Window closed.");
- }
-
- public void windowIconified(WindowEvent e)
- {
- System.out.println("Window iconified.");
- }
-
- public void windowDeiconified(WindowEvent e)
- {
- System.out.println("Window deiconified.");
- }
-
- public void windowActivated(WindowEvent e)
- {
-
- System.out.println("Window activated.");
- }
-
- public void windowDeactivated(WindowEvent e)
- {
- System.out.println("Window deactivated");
- }
-
- public static void main(String s[])
- {
- JFrame frame = new JFrame("Windows1");
-
- frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- frame.addWindowListener(new Windows1());
-
-
-
- frame.getContentPane().add( new Label("Hello World"), "Center");
-
- frame.pack();
- frame.setVisible(true);
- }
-
-
- }
-