Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
Nested Class Summary | |
protected class |
Nested classes/interfaces inherited from class java.awt.Container | |
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component | |
Component.AccessibleAWTComponent , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
|
|
AccessibleContext |
|
BufferStrategy |
|
Container |
|
Component |
|
boolean |
|
GraphicsConfiguration |
|
Locale |
|
Component |
|
Window[] | |
Window |
|
Toolkit |
|
String |
|
WindowFocusListener[] |
|
WindowListener[] |
|
WindowStateListener[] |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
boolean | |
protected void |
|
protected void |
|
protected void | |
protected void | |
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void | |
void |
|
void |
|
@Deprecated | |
@Deprecated |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public Window(Frame owner)
Initializes a new instance ofWindow
with the specified parent. The window will initially be invisible.
- Parameters:
owner
- The owningFrame
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.
public Window(Window owner)
Initializes a new instance ofWindow
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
public Window(Window owner, GraphicsConfiguration gc)
Initializes a new instance ofWindow
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
public void addWindowFocusListener(WindowFocusListener wfl)
Adds the specified listener to this window.
public void addWindowListener(WindowListener listener)
Adds the specified listener to the list ofWindowListeners
that will receive events for this window.
- Parameters:
listener
- TheWindowListener
to add.
public void addWindowStateListener(WindowStateListener wsl)
Adds the specified listener to this window.
- Since:
- 1.4
public void applyResourceBundle(ResourceBundle rb)
Deprecated. replaced by Component.applyComponentOrientation.
- Since:
- 1.2
public void createBufferStrategy(int numBuffers)
Creates a buffering strategy that manages how this window is repainted. This method attempts to create the optimum strategy based on the desired number of buffers. Hardware or software acceleration may be used. createBufferStrategy attempts different levels of optimization, but guarantees that some strategy with the requested number of buffers will be created even if it is not optimal. First it attempts to create a page flipping strategy, then an accelerated blitting strategy, then an unaccelerated blitting strategy. Calling this method causes any existing buffer strategy to be destroyed.
- Parameters:
numBuffers
- the number of buffers in this strategy
- Throws:
IllegalArgumentException
- if requested number of buffers is less than oneIllegalStateException
- if this window is not displayable
- Since:
- 1.4
public void createBufferStrategy(int numBuffers, BufferCapabilities caps) throws AWTException
Creates a buffering strategy that manages how this window is repainted. This method attempts to create a strategy based on the specified capabilities and throws an exception if the requested strategy is not supported. Calling this method causes any existing buffer strategy to be destroyed.
- Parameters:
numBuffers
- the number of buffers in this strategycaps
- the requested buffering capabilities
- Throws:
AWTException
- if the requested capabilities are not supportedIllegalArgumentException
- if requested number of buffers is less than one or if caps is null
- Since:
- 1.4
public void dispose()
Destroys any resources associated with this window. This includes all components in the window and all owned top-level windows.
publicextends EventListener> T[] getListeners (ClasslistenerType)
Returns an array of all the objects currently registered as FooListeners upon this Window. FooListeners are registered using the addFooListener method.
- Overrides:
- extends EventListener> T[] getListeners in interface Container
- Throws:
ClassCastException
- If listenerType doesn't specify a class or interface that implements java.util.EventListener.
- Since:
- 1.3
public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with thisWindow
. The context is created, if necessary.
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface Component
- Returns:
- the associated context
public BufferStrategy getBufferStrategy()
Returns the buffer strategy used by the window.
- Returns:
- the buffer strategy.
- Since:
- 1.4
public final Container getFocusCycleRootAncestor()
Returns the root container that owns the focus cycle where this component resides. Windows have no ancestors and this method returns alwaysnull
.
- Overrides:
- getFocusCycleRootAncestor in interface Component
- Returns:
- Always
null
.
- Since:
- 1.4
public Component getFocusOwner()
Returns the child window that has focus if this window is active. This method returnsnull
if this window is not active or no children have focus.
- Returns:
- The component that has focus, or
null
if no component has focus.
public boolean getFocusableWindowState()
Returns the value of the focusableWindowState property.
- Since:
- 1.4
public GraphicsConfiguration getGraphicsConfiguration()
Get graphics configuration. The implementation for Window will not ask any parent containers, since Window is a toplevel window and not actually embedded in the parent component.
- Overrides:
- getGraphicsConfiguration in interface Component
public Locale getLocale()
Returns the locale that this window is configured for.
- Returns:
- The locale this window is configured for.
public Component getMostRecentFocusOwner()
Returns the child component of this window that would receive focus if this window were to become focused. If the window already has the top-level focus, then this method returns the same component as getFocusOwner. If no child component has requested focus within the window, then the initial focus owner is returned. If this is a non-focusable window, this method returns null.
- Returns:
- the child component of this window that most recently had the focus, or
null
- Since:
- 1.4
public Toolkit getToolkit()
Returns the toolkit used to create this window.
- Overrides:
- getToolkit in interface Component
- Returns:
- The toolkit used to create this window.
public final String getWarningString()
Returns the warning string that will be displayed if this window is popped up by an unsecure applet or application.
- Returns:
- The unsecure window warning message.
public WindowFocusListener[] getWindowFocusListeners()
Returns an array of all the window focus listeners registered on this window.
- Since:
- 1.4
public WindowListener[] getWindowListeners()
Returns an array of all the window listeners registered on this window.
- Since:
- 1.4
public WindowStateListener[] getWindowStateListeners()
Returns an array of all the window state listeners registered on this window.
- Since:
- 1.4
public boolean isActive()
Identifies if this window is active. The active window is a Frame or Dialog that has focus or owns the active window.
- Returns:
- true if active, else false.
- Since:
- 1.4
public final boolean isAlwaysOnTop()
Returns whether the Windows is an always-on-top window, meaning whether the window can be obscured by other windows or not.
- Returns:
true
if the windows is always-on-top,false
otherwise.
- Since:
- 1.5
public final boolean isFocusCycleRoot()
Check whether this Container is a focus cycle root. Returns alwaystrue
as Windows are the root of the focus cycle.
- Overrides:
- isFocusCycleRoot in interface Container
- Returns:
- Always
true
.
- Since:
- 1.4
public final boolean isFocusableWindow()
Returns whether thisWindow
can get the focus or not.
- Since:
- 1.4
public boolean isFocused()
Identifies if this window is focused. A window is focused if it is the focus owner or it contains the focus owner.
- Returns:
- true if focused, else false.
- Since:
- 1.4
public boolean isShowing()
Tests whether or not this window is visible on the screen. In contrast to the normal behaviour of Container, which is that a container is showing if its parent is visible and showing, a Window is even showing, if its parent (i.e. an invisible Frame) is not showing.
- Returns:
true
if this window is visible,false
otherwise.
public boolean postEvent(Event e)
Deprecated.
Post a Java 1.0 event to the event queue.
- Specified by:
- postEvent in interface MenuContainer
- Parameters:
e
- The event to post.
protected void processEvent(AWTEvent evt)
Processes the specified event for this window. If the event is an instance ofWindowEvent
, thenprocessWindowEvent()
is called to process the event, otherwise the superclass version of this method is invoked.
- Overrides:
- processEvent in interface Container
- Parameters:
evt
- The event to process.
protected void processWindowEvent(WindowEvent evt)
Dispatches this event to any listeners that are listening forWindowEvents
on this window. This method only gets invoked if it is enabled viaenableEvents()
or if a listener has been added.
- Parameters:
evt
- The event to process.
public void removeWindowFocusListener(WindowFocusListener wfl)
Removes the specified listener from this window.
public void removeWindowListener(WindowListener listener)
Removes the specified listener from the list ofWindowListeners
that will receive events for this window.
- Parameters:
listener
- TheWindowListener
to remove.
public void removeWindowStateListener(WindowStateListener wsl)
Removes the specified listener from this window.
- Since:
- 1.4
public final void setAlwaysOnTop(boolean alwaysOnTop)
Sets the always-on-top state of this window (if supported). Setting a window to always-on-top means it will not be obscured by any other windows (with the exception of other always-on-top windows). Not all platforms may support this. If an window's always-on-top status is changed to false, the window will remain at the front but not be anchored there. Calling toBack() on an always-on-top window will change its always-on-top status to false.
- Since:
- 1.5
public void setCursor(Cursor cursor)
Sets the cursor for this window to the specifiec cursor.
- Parameters:
cursor
- The new cursor for this window.
public final void setFocusCycleRoot(boolean focusCycleRoot)
Set whether or not this Container is the root of a focus traversal cycle. Windows are the root of the focus cycle and therefore this method does nothing.
- Overrides:
- setFocusCycleRoot in interface Container
- Parameters:
focusCycleRoot
- ignored.
- Since:
- 1.4
public void setFocusableWindowState(boolean focusableWindowState)
Sets the value of the focusableWindowState property.
- Since:
- 1.4
public void toBack()
Sends this window to the back so that all other windows display in front of it. If the window is set to be always-on-top, this will remove its always-on-top status.
public void toFront()
Brings this window to the front so that it displays in front of any other windows.
public @Deprecated void show()
Shows on-screen this window and any of its owned windows for whom isVisible returns true.