|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window
Unsafe:
Field Summary | |
private static String |
base
|
private static sun.awt.DebugHelper |
dbg
|
private boolean |
focusableWindowState
Indicates whether this Window can become the focused Window. |
private FocusManager |
focusMgr
Unused. |
(package private) java.awt.im.InputContext |
inputContext
|
private Object |
inputContextLock
|
(package private) boolean |
isFirstPack
|
private static int |
nameCounter
|
(package private) static int |
OPENED
|
(package private) Vector |
ownedWindowList
A vector containing all the windows this window currently owns. |
private static long |
serialVersionUID
|
private boolean |
showWithParent
|
(package private) int |
state
An Integer value representing the Window State. |
(package private) boolean |
syncLWRequests
|
(package private) static boolean |
systemSyncLWRequests
|
(package private) String |
warningString
This represents the warning message that is to be displayed in a non secure window. |
private java.lang.ref.WeakReference |
weakThis
|
(package private) WindowFocusListener |
windowFocusListener
|
(package private) WindowListener |
windowListener
|
private int |
windowSerializedDataVersion
The window serialized data version. |
(package private) WindowStateListener |
windowStateListener
|
Fields inherited from class java.awt.Container |
component, containerListener, descendantsCount, INCLUDE_SELF, layoutMgr, listeningBoundsChildren, listeningChildren, ncomponents, SEARCH_HEAVYWEIGHTS |
Constructor Summary | |
(package private) |
Window()
Constructs a new window in the default size. |
|
Window(Frame owner)
Suppressed: Constructs a new invisible window with the specified Frame as its owner. |
(package private) |
Window(GraphicsConfiguration gc)
Constructs a new window in default size with the specified GraphicsConfiguration . |
|
Window(Window owner)
Suppressed: Constructs a new invisible window with the specified Window as its owner. |
|
Window(Window owner,
GraphicsConfiguration gc)
Suppressed: Constructs a new invisible window with the specified window as its owner and a GraphicsConfiguration of a screen device. |
Method Summary | |
void |
addNotify()
Suppressed: Makes this Window displayable by creating the connection to its native screen resource. |
(package private) void |
addOwnedWindow(java.lang.ref.WeakReference weakWindow)
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Suppressed: Adds a PropertyChangeListener to the listener list. |
void |
addPropertyChangeListener(String propertyName,
java.beans.PropertyChangeListener listener)
Suppressed: Adds a PropertyChangeListener to the listener list for a specific property. |
void |
addWindowFocusListener(WindowFocusListener l)
Suppressed: Adds the specified window focus listener to receive window events from this window. |
void |
addWindowListener(WindowListener l)
Enabled: Adds the specified window listener to receive window events from this window. |
void |
addWindowStateListener(WindowStateListener l)
Suppressed: Adds the specified window state listener to receive window events from this window. |
(package private) void |
adjustDecendantsOnParent(int num)
|
(package private) void |
adjustListeningChildrenOnParent(long mask,
int num)
|
void |
applyResourceBundle(ResourceBundle rb)
Deprecated. As of J2SE 1.4, replaced by Component.applyComponentOrientation . |
void |
applyResourceBundle(String rbName)
Deprecated. As of J2SE 1.4, replaced by Component.applyComponentOrientation . |
(package private) void |
clearMostRecentFocusOwnerOnHide()
|
(package private) void |
connectOwnedWindow(Window child)
|
(package private) String |
constructComponentName()
Construct a name for this component. |
void |
createBufferStrategy(int numBuffers)
Enabled: Creates a new strategy for multi-buffering on this component. |
void |
createBufferStrategy(int numBuffers,
BufferCapabilities caps)
Enabled: Creates a new strategy for multi-buffering on this component with the required buffer capabilities. |
(package private) void |
deliverMouseWheelToAncestor(MouseWheelEvent e)
Overridden from Component. |
(package private) void |
dispatchEventImpl(AWTEvent e)
Dispatches an event to this window or one of its sub components. |
(package private) boolean |
dispatchMouseWheelToAncestor(MouseWheelEvent e)
Overridden from Component. |
void |
dispose()
Enabled: Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. |
(package private) boolean |
eventEnabled(AWTEvent e)
|
protected void |
finalize()
Disposes of the input methods and context, and removes the WeakReference which formerly pointed to this Window from the parent's owned Window list. |
AccessibleContext |
getAccessibleContext()
Suppressed: Gets the AccessibleContext associated with this Window. |
java.awt.image.BufferStrategy |
getBufferStrategy()
Enabled: @return the buffer strategy used by this component |
boolean |
getFocusableWindowState()
Suppressed: Returns whether this Window can become the focused Window if it meets the other requirements outlined in isFocusableWindow . |
Container |
getFocusCycleRootAncestor()
Suppressed: Always returns null because Windows have no ancestors; they
represent the top of the Component hierarchy. |
Component |
getFocusOwner()
Suppressed: Returns the child Component of this Window that has focus if this Window is focused; returns null otherwise. |
Set |
getFocusTraversalKeys(int id)
Enabled: Gets a focus traversal key for this Window. |
GraphicsConfiguration |
getGraphicsConfiguration()
Suppressed: This method returns the GraphicsConfiguration used by this Window. |
java.awt.im.InputContext |
getInputContext()
Suppressed: Gets the input context for this window. |
EventListener[] |
getListeners(Class listenerType)
Suppressed: Returns an array of all the objects currently registered as FooListener s
upon this Window . |
Locale |
getLocale()
Suppressed: Gets the Locale object that is associated
with this window, if the locale has been set. |
Component |
getMostRecentFocusOwner()
Suppressed: Returns the child Component of this Window that will receive the focus when this Window is focused. |
Window[] |
getOwnedWindows()
Suppressed: Return an array containing all the windows this window currently owns. |
Window |
getOwner()
Suppressed: Returns the owner of this window. |
Toolkit |
getToolkit()
Suppressed: Returns the toolkit of this frame. |
String |
getWarningString()
Suppressed: Gets the warning string that is displayed with this window. |
WindowFocusListener[] |
getWindowFocusListeners()
Suppressed: Returns an array of all the window focus listeners registered on this window. |
WindowListener[] |
getWindowListeners()
Suppressed: Returns an array of all the window listeners registered on this window. |
WindowStateListener[] |
getWindowStateListeners()
Suppressed: Returns an array of all the window state listeners registered on this window. |
void |
hide()
Enabled: Hide this Window, its subcomponents, and all of its owned children. |
private void |
init(GraphicsConfiguration gc)
|
private static void |
initIDs()
Initialize JNI field and method IDs for fields that may be accessed from C. |
boolean |
isActive()
Enabled: Returns whether this Window is active. |
boolean |
isFocusableWindow()
Suppressed: Returns whether this Window can become the focused Window, that is, whether this Window or any of its subcomponents can become the focus owner. |
boolean |
isFocusCycleRoot()
Suppressed: Always returns true because all Windows must be roots of a
focus traversal cycle. |
boolean |
isFocused()
Enabled: Returns whether this Window is focused. |
boolean |
isShowing()
Enabled: Checks if this Window is showing on screen. |
private void |
ownedInit(Window owner)
|
void |
pack()
Enabled: Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. |
boolean |
postEvent(Event e)
Suppressed: @deprecated As of JDK version 1.1 replaced by dispatchEvent(AWTEvent) . |
(package private) void |
postProcessKeyEvent(KeyEvent e)
|
(package private) void |
postWindowEvent(int id)
|
(package private) void |
preProcessKeyEvent(KeyEvent e)
Implements a debugging hook -- checks to see if the user has typed control-shift-F1. |
protected void |
processEvent(AWTEvent e)
Processes events on this window. |
protected void |
processWindowEvent(WindowEvent e)
Processes window events occurring on this window by dispatching them to any registered WindowListener objects. |
protected void |
processWindowFocusEvent(WindowEvent e)
Processes window focus event occuring on this window by dispatching them to any registered WindowFocusListener objects. |
protected void |
processWindowStateEvent(WindowEvent e)
Processes window state event occuring on this window by dispatching them to any registered WindowStateListener
objects. |
private void |
readObject(ObjectInputStream s)
Reads the ObjectInputStream and an optional
list of listeners to receive various events fired by
the component; also reads a list of
(possibly null ) child windows. |
(package private) void |
removeOwnedWindow(java.lang.ref.WeakReference weakWindow)
|
void |
removeWindowFocusListener(WindowFocusListener l)
Suppressed: Removes the specified window focus listener so that it no longer receives window events from this window. |
void |
removeWindowListener(WindowListener l)
Enabled: Removes the specified window listener so that it no longer receives window events from this window. |
void |
removeWindowStateListener(WindowStateListener l)
Suppressed: Removes the specified window state listener so that it no longer receives window events from this window. |
(package private) void |
resetGC()
Reset this Window's GraphicsConfiguration to match its peer. |
void |
setCursor(Cursor cursor)
Suppressed: Set the cursor image to a specified cursor. |
void |
setFocusableWindowState(boolean focusableWindowState)
Suppressed: Sets whether this Window can become the focused Window if it meets the other requirements outlined in isFocusableWindow . |
void |
setFocusCycleRoot(boolean focusCycleRoot)
Suppressed: Does nothing because Windows must always be roots of a focus traversal cycle. |
void |
setLocationRelativeTo(Component c)
Enabled: Sets the location of the window relative to the specified component. |
private void |
setWarningString()
|
void |
show()
Enabled: Makes the Window visible. |
void |
toBack()
Enabled: If this Window is visible, sends this Window to the back and may cause it to lose focus or activation if it is the focused or active Window. |
void |
toFront()
Suppressed: If this Window is visible, brings this Window to the front and may make it the focused Window. |
private void |
writeObject(ObjectOutputStream s)
Writes default serializable fields to stream. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
String warningString
getWarningString()
static boolean systemSyncLWRequests
boolean syncLWRequests
boolean isFirstPack
static final int OPENED
int state
show()
transient Vector ownedWindowList
getOwnedWindows()
private transient java.lang.ref.WeakReference weakThis
private transient boolean showWithParent
transient WindowListener windowListener
transient WindowStateListener windowStateListener
transient WindowFocusListener windowFocusListener
transient java.awt.im.InputContext inputContext
private transient Object inputContextLock
private FocusManager focusMgr
private boolean focusableWindowState
getFocusableWindowState()
,
setFocusableWindowState(boolean)
private static final String base
private static int nameCounter
private static final long serialVersionUID
private static final sun.awt.DebugHelper dbg
private int windowSerializedDataVersion
Constructor Detail |
Window(GraphicsConfiguration gc)
GraphicsConfiguration
.
If there is a security manager, this method first calls
the security manager's checkTopLevelWindow
method with this
as its argument to determine whether or not the window
must be displayed with a warning banner.
gc
- the GraphicsConfiguration
of the target screen device. If gc
is
null
, the system default
GraphicsConfiguration
is assumed.java.awt.GraphicsEnvironment#isHeadless
,
java.lang.SecurityManager#checkTopLevelWindow
Window() throws HeadlessException
First, if there is a security manager, its
checkTopLevelWindow
method is called with this
as its argument
to see if it's ok to display the window without a warning banner.
If the default implementation of checkTopLevelWindow
is used (that is, that method is not overriden), then this results in
a call to the security manager's checkPermission
method
with an AWTPermission("showWindowWithoutWarningBanner")
permission. It that method raises a SecurityException,
checkTopLevelWindow
returns false, otherwise it
returns true. If it returns false, a warning banner is created.
java.awt.GraphicsEnvironment#isHeadless
,
java.lang.SecurityManager#checkTopLevelWindow
public Window(Frame owner)
Frame
as its owner. The Window will not be focusable
unless its owner is showing on the screen.
If there is a security manager, this method first calls
the security manager's checkTopLevelWindow
method with this
as its argument to determine whether or not the window
must be displayed with a warning banner.
owner
- the Frame
to act as ownerjava.awt.GraphicsEnvironment#isHeadless
,
java.lang.SecurityManager#checkTopLevelWindow
,
isShowing()
public Window(Window owner)
Window
as its owner. The Window will not be focusable
unless its nearest owning Frame or Dialog is showing on the screen.
If there is a security manager, this method first calls
the security manager's checkTopLevelWindow
method with this
as its argument to determine whether or not the window
must be displayed with a warning banner.
owner
- the Window
to act as ownerjava.awt.GraphicsEnvironment#isHeadless
,
java.lang.SecurityManager#checkTopLevelWindow
,
isShowing()
public Window(Window owner, GraphicsConfiguration gc)
GraphicsConfiguration
of a screen device. The Window will
not be focusable unless its nearest owning Frame or Dialog is showing on
the screen.
If there is a security manager, this method first calls
the security manager's checkTopLevelWindow
method with this
as its argument to determine whether or not the window
must be displayed with a warning banner.
owner
- the window to act as ownergc
- the GraphicsConfiguration
of the target screen device; if gc
is
null
, the system default
GraphicsConfiguration
is assumed
IllegalArgumentException
- if
owner
is null
IllegalArgumentException
- if gc
is not from
a screen device; this exception is always thrown when
GraphicsEnvironment.isHeadless
returns
true
java.awt.GraphicsEnvironment#isHeadless
,
java.lang.SecurityManager#checkTopLevelWindow
,
GraphicsConfiguration.getBounds()
,
isShowing()
Method Detail |
private static void initIDs()
private void init(GraphicsConfiguration gc)
private void ownedInit(Window owner)
protected void finalize() throws Throwable
finalize
in class Object
Throwable
- the Exception
raised by this methodString constructComponentName()
constructComponentName
in class Component
public void addNotify()
addNotify
in class Container
Component.isDisplayable()
,
Container.removeNotify()
public void pack()
Component.isDisplayable()
public void show()
show
in class Component
Component.isDisplayable()
,
toFront()
,
Component.setVisible(boolean)
void postWindowEvent(int id)
public void hide()
show
.
hide
in class Component
show()
,
dispose()
final void clearMostRecentFocusOwnerOnHide()
clearMostRecentFocusOwnerOnHide
in class Container
public void dispose()
The Window and its subcomponents can be made displayable again
by rebuilding the native resources with a subsequent call to
pack
or show
. The states of the recreated
Window and its subcomponents will be identical to the states of these
objects at the point where the Window was disposed (not accounting for
additional modifcations between those actions).
Component.isDisplayable()
,
pack()
,
show()
void adjustListeningChildrenOnParent(long mask, int num)
adjustListeningChildrenOnParent
in class Component
void adjustDecendantsOnParent(int num)
adjustDecendantsOnParent
in class Container
public void toFront()
Places this Window at the top of the stacking order and shows it in front of any other Windows in this VM. No action will take place is this Window is not visible. Some platforms do not allow Windows which own other Windows to appear on top of those owned Windows. Some platforms may not permit this VM to place its Windows above windows of native applications, or Windows of other VMs. This permission may depend on whether a Window in this VM is already focused. Every attempt will be made to move this Window as high as possible in the stacking order; however, developers should not assume that this method will move this Window above all other windows in every situation.
Because of variations in native windowing systems, no guarantees about changes to the focused and active Windows can be made. Developers must never assume that this Window is the focused or active Window until this Window receives a WINDOW_GAINED_FOCUS or WINDOW_ACTIVATED event. On platforms where the top-most window is the focused window, this method will probably focus this Window, if it is not already focused. On platforms where the stacking order does not typically affect the focused window, this method will probably leave the focused and active Windows unchanged.
If this method causes this Window to be focused, and this Window is a Frame or a Dialog, it will also become activated. If this Window is focused, but it is not a Frame or a Dialog, then the first Frame or Dialog that is an owner of this Window will be activated.
toBack()
public void toBack()
Places this Window at the bottom of the stacking order and shows it behind any other Windows in this VM. No action will take place is this Window is not visible. Some platforms do not allow Windows which are owned by other Windows to appear below their owners. Every attempt will be made to move this Window as low as possible in the stacking order; however, developers should not assume that this method will move this Window below all other windows in every situation.
Because of variations in native windowing systems, no guarantees about changes to the focused and active Windows can be made. Developers must never assume that this Window is no longer the focused or active Window until this Window receives a WINDOW_LOST_FOCUS or WINDOW_DEACTIVATED event. On platforms where the top-most window is the focused window, this method will probably cause this Window to lose focus. In that case, the next highest, focusable Window in this VM will receive focus. On platforms where the stacking order does not typically affect the focused window, this method will probably leave the focused and active Windows unchanged.
toFront()
public Toolkit getToolkit()
getToolkit
in class Component
Toolkit
,
Toolkit.getDefaultToolkit()
,
Component.getToolkit()
public final String getWarningString()
checkTopLevelWindow
method returns
false
when this window is passed to it as an
argument.
If the window is secure, then getWarningString
returns null
. If the window is insecure, this
method checks for the system property
awt.appletWarning
and returns the string value of that property.
java.lang.SecurityManager#checkTopLevelWindow(java.lang.Object)
private void setWarningString()
public Locale getLocale()
Locale
object that is associated
with this window, if the locale has been set.
If no locale has been set, then the default locale
is returned.
getLocale
in class Component
java.util.Locale
public java.awt.im.InputContext getInputContext()
getInputContext
in class Component
null
if no context can be determinedComponent.getInputContext()
public void setCursor(Cursor cursor)
setCursor
in class Component
cursor
- One of the constants defined
by the Cursor
class;
if this parameter is null
then this component will inherit
the cursor of its parentComponent.getCursor()
,
Cursor
public Window getOwner()
public Window[] getOwnedWindows()
public void addWindowListener(WindowListener l)
l
- the window listenerremoveWindowListener(java.awt.event.WindowListener)
,
getWindowListeners()
public void addWindowStateListener(WindowStateListener l)
l
is null,
no exception is thrown and no action is performed.
l
- the window state listenerremoveWindowStateListener(java.awt.event.WindowStateListener)
,
getWindowStateListeners()
public void addWindowFocusListener(WindowFocusListener l)
l
- the window focus listenerremoveWindowFocusListener(java.awt.event.WindowFocusListener)
,
getWindowFocusListeners()
public void removeWindowListener(WindowListener l)
l
- the window listeneraddWindowListener(java.awt.event.WindowListener)
,
getWindowListeners()
public void removeWindowStateListener(WindowStateListener l)
l
is null
, no exception is thrown and
no action is performed.
l
- the window state listeneraddWindowStateListener(java.awt.event.WindowStateListener)
,
getWindowStateListeners()
public void removeWindowFocusListener(WindowFocusListener l)
l
- the window focus listeneraddWindowFocusListener(java.awt.event.WindowFocusListener)
,
getWindowFocusListeners()
public WindowListener[] getWindowListeners()
WindowListener
s
or an empty array if no window
listeners are currently registeredaddWindowListener(java.awt.event.WindowListener)
,
removeWindowListener(java.awt.event.WindowListener)
public WindowFocusListener[] getWindowFocusListeners()
WindowFocusListener
s
or an empty array if no window focus
listeners are currently registeredaddWindowFocusListener(java.awt.event.WindowFocusListener)
,
removeWindowFocusListener(java.awt.event.WindowFocusListener)
public WindowStateListener[] getWindowStateListeners()
WindowStateListener
s
or an empty array if no window state
listeners are currently registeredaddWindowStateListener(java.awt.event.WindowStateListener)
,
removeWindowStateListener(java.awt.event.WindowStateListener)
public EventListener[] getListeners(Class listenerType)
FooListener
s
upon this Window
.
FooListener
s are registered using the
addFooListener
method.
You can specify the listenerType
argument
with a class literal, such as
FooListener.class
.
For example, you can query a
Window
w
for its window listeners with the following code:
WindowListener[] wls = (WindowListener[])(w.getListeners(WindowListener.class));If no such listeners exist, this method returns an empty array.
getListeners
in class Container
listenerType
- the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListener
s on this window,
or an empty array if no such
listeners have been addedgetWindowListeners()
boolean eventEnabled(AWTEvent e)
eventEnabled
in class Container
protected void processEvent(AWTEvent e)
WindowEvent
, it invokes the
processWindowEvent
method, else it invokes its
superclass's processEvent
.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
processEvent
in class Container
e
- the eventprotected void processWindowEvent(WindowEvent e)
addWindowListener
enableEvents
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
e
- the window eventComponent.enableEvents(long)
protected void processWindowFocusEvent(WindowEvent e)
addWindowFocusListener
enableEvents
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
e
- the window focus eventComponent.enableEvents(long)
protected void processWindowStateEvent(WindowEvent e)
WindowStateListener
objects.
NOTE: this method will not be called unless window state events
are enabled for this window. This happens when one of the
following occurs:
WindowStateListener
is registered via
addWindowStateListener
enableEvents
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
e
- the window state eventjava.awt.Component#enableEvents
void preProcessKeyEvent(KeyEvent e)
System.out
.
preProcessKeyEvent
in class Container
e
- the keyboard eventvoid postProcessKeyEvent(KeyEvent e)
postProcessKeyEvent
in class Container
public Component getFocusOwner()
getMostRecentFocusOwner()
,
isFocused()
public Component getMostRecentFocusOwner()
getFocusOwner()
. If
this Window is not focused, then the child Component that most recently
requested focus will be returned. If no child Component has ever
requested focus, and this is a focusable Window, then this Window's
initial focusable Component is returned. If no child Component has ever
requested focus, and this is a non-focusable Window, null is returned.
getFocusOwner()
,
isFocused()
,
isFocusableWindow()
public boolean isActive()
isFocused()
public boolean isFocused()
If the focused Window is a Frame or a Dialog it is also the active Window. Otherwise, the active Window is the first Frame or Dialog that is an owner of the focused Window.
isActive()
public Set getFocusTraversalKeys(int id)
setFocusTraversalKeys
for a full description of each key.)
If the traversal key has not been explicitly set for this Window, then this Window's parent's traversal key is returned. If the traversal key has not been explicitly set for any of this Window's ancestors, then the current KeyboardFocusManager's default traversal key is returned.
getFocusTraversalKeys
in class Container
id
- one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
IllegalArgumentException
- if id is not one of
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYSContainer.setFocusTraversalKeys(int, java.util.Set)
,
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS
,
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS
,
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
,
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
public final void setFocusCycleRoot(boolean focusCycleRoot)
setFocusCycleRoot
in class Container
focusCycleRoot
- this value is ignoredisFocusCycleRoot()
,
Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,
Container.getFocusTraversalPolicy()
public final boolean isFocusCycleRoot()
true
because all Windows must be roots of a
focus traversal cycle.
isFocusCycleRoot
in class Container
true
setFocusCycleRoot(boolean)
,
Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
,
Container.getFocusTraversalPolicy()
public final Container getFocusCycleRootAncestor()
null
because Windows have no ancestors; they
represent the top of the Component hierarchy.
getFocusCycleRootAncestor
in class Component
null
Container.isFocusCycleRoot()
public final boolean isFocusableWindow()
true
. For a Window which is not a Frame or
Dialog to be focusable, its focusable Window state must be set to
true
, its nearest owning Frame or Dialog must be
showing on the screen, and it must contain at least one Component in
its focus traversal cycle. If any of these conditions is not met, then
neither this Window nor any of its subcomponents can become the focus
owner.
true
if this Window can be the focused Window;
false
otherwisegetFocusableWindowState()
,
setFocusableWindowState(boolean)
,
isShowing()
,
Component.isFocusable()
public boolean getFocusableWindowState()
isFocusableWindow
. If
this method returns false
, then
isFocusableWindow
will return false
as well.
If this method returns true
, then
isFocusableWindow
may return true
or
false
depending upon the other requirements which must be
met in order for a Window to be focusable.
By default, all Windows have a focusable Window state of
true
.
isFocusableWindow()
,
setFocusableWindowState(boolean)
,
isShowing()
,
Component.setFocusable(boolean)
public void setFocusableWindowState(boolean focusableWindowState)
isFocusableWindow
. If
this Window's focusable Window state is set to false
, then
isFocusableWindow
will return false
. If this
Window's focusable Window state is set to true
, then
isFocusableWindow
may return true
or
false
depending upon the other requirements which must be
met in order for a Window to be focusable.
Setting a Window's focusability state to false
is the
standard mechanism for an application to identify to the AWT a Window
which will be used as a floating palette or toolbar, and thus should be
a non-focusable Window.
focusableWindowState
- whether this Window can be the focused
WindowisFocusableWindow()
,
getFocusableWindowState()
,
isShowing()
,
Component.setFocusable(boolean)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
If listener is null, no exception is thrown and no action is performed.
addPropertyChangeListener
in class Container
listener
- the PropertyChangeListener to be addedComponent.removePropertyChangeListener(java.beans.PropertyChangeListener)
,
addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
public void addPropertyChangeListener(String propertyName, java.beans.PropertyChangeListener listener)
If listener is null, no exception is thrown and no action is performed.
addPropertyChangeListener
in class Container
propertyName
- one of the property names listed abovelistener
- the PropertyChangeListener to be addedaddPropertyChangeListener(java.beans.PropertyChangeListener)
,
Component.removePropertyChangeListener(java.beans.PropertyChangeListener)
void dispatchEventImpl(AWTEvent e)
dispatchEventImpl
in class Container
e
- the eventpublic boolean postEvent(Event e)
dispatchEvent(AWTEvent)
.
postEvent
in interface MenuContainer
postEvent
in class Component
public boolean isShowing()
isShowing
in class Component
true
if the component is showing,
false
otherwiseComponent.setVisible(boolean)
public void applyResourceBundle(ResourceBundle rb)
Component.applyComponentOrientation
.
ComponentOrientation
public void applyResourceBundle(String rbName)
Component.applyComponentOrientation
.
ComponentOrientation
void addOwnedWindow(java.lang.ref.WeakReference weakWindow)
void removeOwnedWindow(java.lang.ref.WeakReference weakWindow)
void connectOwnedWindow(Window child)
private void writeObject(ObjectOutputStream s) throws IOException
WindowListener
s and
WindowFocusListener
s as optional data.
Writes a list of child windows as optional data.
s
- the ObjectOutputStream
to write
IOException
AWTEventMulticaster.save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener)
,
Component.windowListenerK
,
Component.windowFocusListenerK
,
Component.ownedWindowK
,
readObject(java.io.ObjectInputStream)
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException
ObjectInputStream
and an optional
list of listeners to receive various events fired by
the component; also reads a list of
(possibly null
) child windows.
Unrecognized keys or values will be ignored.
s
- the ObjectInputStream
to read
ClassNotFoundException
IOException
HeadlessException
java.awt.GraphicsEnvironment#isHeadless
,
writeObject(java.io.ObjectOutputStream)
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
getAccessibleContext
in class Component
public GraphicsConfiguration getGraphicsConfiguration()
getGraphicsConfiguration
in class Component
GraphicsConfiguration
used by this
Component
or null
void resetGC()
resetGC
in class Component
public void setLocationRelativeTo(Component c)
c
is null
, the
window is centered on the screen. If the bottom of the
component is offscreen, the window is displayed to the
right of the component.
c
- the component in relation to which the window's location
is determinedvoid deliverMouseWheelToAncestor(MouseWheelEvent e)
boolean dispatchMouseWheelToAncestor(MouseWheelEvent e)
dispatchMouseWheelToAncestor
in class Component
public void createBufferStrategy(int numBuffers)
BufferStrategy
with that number of buffers.
A page-flipping strategy is attempted first, then a blitting strategy
using accelerated buffers. Finally, an unaccelerated blitting
strategy is used.
Each time this method is called, the existing buffer strategy for this component is discarded.
createBufferStrategy
in class Component
numBuffers
- number of buffers to createComponent.isDisplayable()
,
getBufferStrategy()
public void createBufferStrategy(int numBuffers, BufferCapabilities caps) throws AWTException
Each time this method is called, the existing buffer strategy for this component is discarded.
createBufferStrategy
in class Component
numBuffers
- number of buffers to create, including the front buffercaps
- the required capabilities for creating the buffer strategy;
cannot be null
AWTException
getBufferStrategy()
public java.awt.image.BufferStrategy getBufferStrategy()
getBufferStrategy
in class Component
createBufferStrategy(int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |