Spec-Zone .ru
спецификации, руководства, описания, API
|
|
JavaTM 2 Platform Standard Edition |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window
A Window
object is a top-level window with no borders and no
menubar.
The default layout for a window is BorderLayout
.
A window must have either a frame, dialog, or another window defined as its owner when it's constructed.
Windows are capable of generating the following window events: WindowOpened, WindowClosed.
WindowEvent
,
addWindowListener(java.awt.event.WindowListener)
,
BorderLayout
, Serialized FormFields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
Window(Frame owner)
Constructs a new invisible window. |
|
Window(Window owner)
Constructs a new invisible window with the specified window as its owner. |
Method Summary | |
void |
addNotify()
Makes this Window displayable by creating the connection to its native screen resource. |
void |
addWindowListener(WindowListener l)
Adds the specified window listener to receive window events from this window. |
void |
applyResourceBundle(ResourceBundle rb)
Apply the settings in the given ResourceBundle to this Window. |
void |
applyResourceBundle(String rbName)
Load the ResourceBundle with the given name using the default locale and apply its settings to this window. |
void |
dispose()
Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. |
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. |
Component |
getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active. |
InputContext |
getInputContext()
Gets the input context for this window. |
Locale |
getLocale()
Gets the Locale object that is associated
with this window, if the locale has been set. |
Window[] |
getOwnedWindows()
Return an array containing all the windows this window currently owns. |
Window |
getOwner()
Returns the owner of this window. |
Toolkit |
getToolkit()
Returns the toolkit of this frame. |
String |
getWarningString()
Gets the warning string that is displayed with this window. |
void |
hide()
Hide this Window, its subcomponents, and all of its owned children. |
boolean |
isShowing()
Checks if this Window is showing on screen. |
void |
pack()
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents. |
boolean |
postEvent(Event e)
Deprecated. As of JDK version 1.1 replaced by dispatchEvent(AWTEvent) . |
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. |
void |
removeWindowListener(WindowListener l)
Removes the specified window listener so that it no longer receives window events from this window. |
void |
setCursor(Cursor cursor)
Set the cursor image to a specified cursor. |
void |
show()
Makes the Window visible. |
void |
toBack()
Sends this window to the back. |
void |
toFront()
Brings this window to the front. |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getAlignmentX,
getAlignmentY,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getInsets,
getLayout,
getMaximumSize,
getMinimumSize,
getPreferredSize,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paint,
paintComponents,
paramString,
preferredSize,
print,
printComponents,
processContainerEvent,
remove,
remove,
removeAll,
removeContainerListener,
removeNotify,
setFont,
setLayout,
update,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Window(Frame owner)
The window is not initially visible. Call the show
method to cause the window to become visible.
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 main application frame.owner
is null
show()
,
Component.setSize(int, int)
,
SecurityManager.checkTopLevelWindow(java.lang.Object)
public Window(Window owner)
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 ownerowner
is null
SecurityManager.checkTopLevelWindow(java.lang.Object)
Method Detail |
protected void finalize() throws Throwable
public void addNotify()
Component.isDisplayable()
,
Container.removeNotify()
public void pack()
Component.isDisplayable()
public void show()
Component.isDisplayable()
,
toFront()
,
Component.setVisible(boolean)
public void hide()
show
.
show()
,
dispose()
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()
public void toFront()
toBack()
public void toBack()
toFront()
public Toolkit getToolkit()
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.
SecurityManager.checkTopLevelWindow(java.lang.Object)
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.Locale
public InputContext getInputContext()
Component.getInputContext()
public void setCursor(Cursor cursor)
cursor
- One of the constants defined
by the Cursor
class. If this parameter is null
then the cursor for this window will be set to the type
Cursor.DEFAULT_CURSOR.Component.getCursor()
,
Cursor
public Window getOwner()
public Window[] getOwnedWindows()
public void addWindowListener(WindowListener l)
l
- the window listenerpublic void removeWindowListener(WindowListener l)
l
- the window listenerprotected void processEvent(AWTEvent e)
e
- the eventprotected void processWindowEvent(WindowEvent e)
e
- the window eventComponent.enableEvents(long)
public Component getFocusOwner()
public boolean postEvent(Event e)
dispatchEvent(AWTEvent)
.
public boolean isShowing()
Component.setVisible(boolean)
public void applyResourceBundle(ResourceBundle rb)
ComponentOrientation
public void applyResourceBundle(String rbName)
ComponentOrientation
|
JavaTM 2 Platform Standard Edition |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |