KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > event > WindowListener


1 /*
2  * @(#)WindowListener.java 1.21 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt.event;
9
10 import java.util.EventListener JavaDoc;
11
12 /**
13  * The listener interface for receiving window events.
14  * The class that is interested in processing a window event
15  * either implements this interface (and all the methods it
16  * contains) or extends the abstract <code>WindowAdapter</code> class
17  * (overriding only the methods of interest).
18  * The listener object created from that class is then registered with a
19  * Window using the window's <code>addWindowListener</code>
20  * method. When the window's status changes by virtue of being opened,
21  * closed, activated or deactivated, iconified or deiconified,
22  * the relevant method in the listener object is invoked, and the
23  * <code>WindowEvent</code> is passed to it.
24  *
25  * @author Carl Quinn
26  * @version 1.21, 12/19/03
27  *
28  * @see WindowAdapter
29  * @see WindowEvent
30  * @see <a HREF="http://java.sun.com/docs/books/tutorial/uiswing/events/windowlistener.html">Tutorial: How to Write Window Listeners</a>
31  *
32  * @since 1.1
33  */

34 public interface WindowListener extends EventListener JavaDoc {
35     /**
36      * Invoked the first time a window is made visible.
37      */

38     public void windowOpened(WindowEvent JavaDoc e);
39
40     /**
41      * Invoked when the user attempts to close the window
42      * from the window's system menu.
43      */

44     public void windowClosing(WindowEvent JavaDoc e);
45
46     /**
47      * Invoked when a window has been closed as the result
48      * of calling dispose on the window.
49      */

50     public void windowClosed(WindowEvent JavaDoc e);
51
52     /**
53      * Invoked when a window is changed from a normal to a
54      * minimized state. For many platforms, a minimized window
55      * is displayed as the icon specified in the window's
56      * iconImage property.
57      * @see java.awt.Frame#setIconImage
58      */

59     public void windowIconified(WindowEvent JavaDoc e);
60
61     /**
62      * Invoked when a window is changed from a minimized
63      * to a normal state.
64      */

65     public void windowDeiconified(WindowEvent JavaDoc e);
66
67     /**
68      * Invoked when the Window is set to be the active Window. Only a Frame or
69      * a Dialog can be the active Window. The native windowing system may
70      * denote the active Window or its children with special decorations, such
71      * as a highlighted title bar. The active Window is always either the
72      * focused Window, or the first Frame or Dialog that is an owner of the
73      * focused Window.
74      */

75     public void windowActivated(WindowEvent JavaDoc e);
76
77     /**
78      * Invoked when a Window is no longer the active Window. Only a Frame or a
79      * Dialog can be the active Window. The native windowing system may denote
80      * the active Window or its children with special decorations, such as a
81      * highlighted title bar. The active Window is always either the focused
82      * Window, or the first Frame or Dialog that is an owner of the focused
83      * Window.
84      */

85     public void windowDeactivated(WindowEvent JavaDoc e);
86 }
87
Popular Tags