java.awt
public class Window extends Container implements Accessible
| Nested Class Summary | |
|---|---|
| protected class | Window.AccessibleAWTWindow |
| Constructor Summary | |
|---|---|
| Window(Frame owner)
Initializes a new instance of Window with the specified
parent. | |
| Window(Window owner)
Initializes a new instance of Window with the specified
parent. | |
| Window(Window owner, GraphicsConfiguration gc)
Initializes a new instance of Window with the specified
parent. | |
| Method Summary | |
|---|---|
| void | addNotify()
Creates the native peer for this window. |
| void | addWindowFocusListener(WindowFocusListener wfl)
Adds the specified listener to this window. |
| void | addWindowListener(WindowListener listener)
Adds the specified listener to the list of WindowListeners
that will receive events for this window.
|
| void | addWindowStateListener(WindowStateListener wsl)
Adds the specified listener to this window.
|
| void | applyResourceBundle(ResourceBundle rb) |
| void | applyResourceBundle(String rbName) |
| void | createBufferStrategy(int numBuffers)
Creates a buffering strategy that manages how this window is
repainted. |
| void | createBufferStrategy(int numBuffers, BufferCapabilities caps)
Creates a buffering strategy that manages how this window is
repainted. |
| void | dispose()
Destroys any resources associated with this window. |
| AccessibleContext | getAccessibleContext()
Gets the AccessibleContext associated with this Window.
|
| BufferStrategy | getBufferStrategy()
Returns the buffer strategy used by the window.
|
| boolean | getFocusableWindowState()
Returns the value of the focusableWindowState property.
|
| Container | getFocusCycleRootAncestor()
Returns the root container that owns the focus cycle where this
component resides. |
| Component | getFocusOwner()
Returns the child window that has focus if this window is active.
|
| GraphicsConfiguration | getGraphicsConfiguration()
Get graphics configuration. |
| <T extends EventListener> T[] | getListeners(Class<T> listenerType)
Returns an array of all the objects currently registered as FooListeners
upon this Window. |
| Locale | getLocale()
Returns the locale that this window is configured for.
|
| Component | getMostRecentFocusOwner()
Returns the child component of this window that would receive
focus if this window were to become focused. |
| Window[] | getOwnedWindows() |
| Window | getOwner() |
| Toolkit | getToolkit()
Returns the toolkit used to create this window.
|
| String | getWarningString()
Returns the warning string that will be displayed if this window is
popped up by an unsecure applet or application.
|
| WindowFocusListener[] | getWindowFocusListeners()
Returns an array of all the window focus listeners registered on this
window.
|
| WindowListener[] | getWindowListeners()
Returns an array of all the window listeners registered on this window.
|
| WindowStateListener[] | getWindowStateListeners()
Returns an array of all the window state listeners registered on this
window.
|
| boolean | isActive()
Identifies if this window is active. |
| boolean | isAlwaysOnTop()
Returns whether the Windows is an always-on-top window,
meaning whether the window can be obscured by other windows or not.
|
| boolean | isFocusableWindow()
Returns whether this Window can get the focus or not.
|
| boolean | isFocusCycleRoot()
Check whether this Container is a focus cycle root.
|
| boolean | isFocused()
Identifies if this window is focused. |
| boolean | isShowing()
Tests whether or not this window is visible on the screen.
|
| void | pack()
Relays out this window's child components at their preferred size.
|
| boolean | postEvent(Event e)
Post a Java 1.0 event to the event queue.
|
| protected void | processEvent(AWTEvent evt)
Processes the specified event for this window. |
| protected void | processWindowEvent(WindowEvent evt)
Dispatches this event to any listeners that are listening for
WindowEvents on this window. |
| protected void | processWindowFocusEvent(WindowEvent event) |
| protected void | processWindowStateEvent(WindowEvent event) |
| void | removeWindowFocusListener(WindowFocusListener wfl)
Removes the specified listener from this window. |
| void | removeWindowListener(WindowListener listener)
Removes the specified listener from the list of
WindowListeners that will receive events for this window.
|
| void | removeWindowStateListener(WindowStateListener wsl)
Removes the specified listener from this window.
|
| void | setAlwaysOnTop(boolean alwaysOnTop)
Sets the always-on-top state of this window (if supported).
|
| void | setCursor(Cursor cursor)
Sets the cursor for this window to the specifiec cursor.
|
| void | setFocusableWindowState(boolean focusableWindowState)
Sets the value of the focusableWindowState property.
|
| void | setFocusCycleRoot(boolean focusCycleRoot)
Set whether or not this Container is the root of a focus
traversal cycle. |
| void | setLocationRelativeTo(Component c) |
| void | toBack()
Sends this window to the back so that all other windows display in
front of it.
|
| void | toFront()
Brings this window to the front so that it displays in front of
any other windows. |
Window with the specified
parent. The window will initially be invisible.
Parameters: owner The owning Frame of this window.
Throws: IllegalArgumentException If the owner's GraphicsConfiguration is not from a screen device, or if owner is null; this exception is always thrown when GraphicsEnvironment.isHeadless returns true.
Window with the specified
parent. The window will initially be invisible.
Throws: IllegalArgumentException If the owner's GraphicsConfiguration is not from a screen device, or if owner is null; this exception is always thrown when GraphicsEnvironment.isHeadless returns true.
Since: 1.2
Window with the specified
parent. The window will initially be invisible.
Throws: IllegalArgumentException If owner is null or if gc is not from a screen device; this exception is always thrown when GraphicsEnvironment.isHeadless returns true.
Since: 1.3
WindowListeners
that will receive events for this window.
Parameters: listener The WindowListener to add.
Since: 1.4
Deprecated: replaced by Component.applyComponentOrientation.
Since: 1.2
Deprecated:
Since: 1.2
Parameters: numBuffers the number of buffers in this strategy
Throws: IllegalArgumentException if requested number of buffers is less than one IllegalStateException if this window is not displayable
Since: 1.4
Parameters: numBuffers the number of buffers in this strategy caps the requested buffering capabilities
Throws: AWTException if the requested capabilities are not supported IllegalArgumentException if requested number of buffers is less than one or if caps is null
Since: 1.4
Window.
The context is created, if necessary.
Returns: the associated context
Returns: the buffer strategy.
Since: 1.4
Since: 1.4
null.
Returns: Always null.
Since: 1.4
null if this window is not active
or no children have focus.
Returns: The component that has focus, or null if no
component has focus.
Throws: ClassCastException If listenerType doesn't specify a class or interface that implements java.util.EventListener.
Since: 1.3
Returns: The locale this window is configured for.
Returns: the child component of this window that most recently had
the focus, or null
Since: 1.4
Since: 1.2
Returns: The toolkit used to create this window.
UNKNOWN: Unlike Component.getToolkit, this implementation always returns the value of Toolkit.getDefaultToolkit().
Returns: The unsecure window warning message.
Since: 1.4
Since: 1.4
Since: 1.4
Returns: true if active, else false.
Since: 1.4
Returns: true if the windows is always-on-top,
false otherwise.
Since: 1.5
Window can get the focus or not.
Since: 1.4
true as Windows are the
root of the focus cycle.
Returns: Always true.
Since: 1.4
Returns: true if focused, else false.
Since: 1.4
Returns: true if this window is visible, false
otherwise.
UNKNOWN: pack() doesn't appear to be called internally by show(), so we duplicate some of the functionality.
Deprecated:
Post a Java 1.0 event to the event queue.Parameters: e The event to post.
WindowEvent, then
processWindowEvent() is called to process the event,
otherwise the superclass version of this method is invoked.
Parameters: evt The event to process.
WindowEvents on this window. This method only gets
invoked if it is enabled via enableEvents() or if
a listener has been added.
Parameters: evt The event to process.
Since: 1.4
WindowListeners that will receive events for this window.
Parameters: listener The WindowListener to remove.
Since: 1.4
Since: 1.5
Parameters: cursor The new cursor for this window.
Since: 1.4
Parameters: focusCycleRoot ignored.
Since: 1.4