|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
public class Window
A Window object is a top-level window with no borders and no
menubar. It could be used to implement a pop-up menu.
The default layout for a window is BorderLayout.
A Window object blocks input to other application
windows when it is shown.
Windows are capable of generating the following window events: WindowOpened, WindowClosed.
UnsupportedOperationException.
java.awt.SupportsWindow is set to "true"
or "false" indicating if the platform supports direct creation
of window objects.
WindowEvent,
addWindowListener(java.awt.event.WindowListener),
BorderLayout,
Serialized Form| 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 | |
|---|---|
Window(Frame parent)
Constructs a new invisible window. |
|
| Method Summary | |
|---|---|
void |
addWindowListener(java.awt.event.WindowListener l)
Adds the specified window listener to receive window events from this window. |
void |
dispose()
Disposes of this window. |
Component |
getFocusOwner()
Returns the child component of this Window which has focus if and only if this Window is active. |
Graphics |
getGraphics()
Creates a graphics context for this component. |
java.awt.Insets |
getInsets()
Determines the insets of this container, which indicate the size of the container's border. |
Locale |
getLocale()
Gets the Locale object that is associated
with this window, if the locale has been set. |
Toolkit |
getToolkit()
Returns the toolkit of this frame. |
String |
getWarningString()
Gets the warning string that is displayed with this window. |
boolean |
isShowing()
Checks if this Window is showing on screen. |
void |
pack()
Causes subcomponents of this window to be laid out at their preferred size. |
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(java.awt.event.WindowEvent e)
Processes window events occurring on this window by dispatching them to any registered WindowListener objects. |
void |
removeWindowListener(java.awt.event.WindowListener l)
Removes the specified window listener so that it no longer receives window events from this window. |
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Repaints the specified rectangle of this component within tm milliseconds. |
void |
setBackground(java.awt.Color c)
Sets the background color of this component. |
void |
setCursor(java.awt.Cursor cursor)
Set the cursor image to a predefined cursor. |
void |
show()
Shows this window, and brings it to the front. |
void |
toBack()
Sends this window to the back. |
void |
toFront()
Brings this window to the front. |
void |
update(Graphics g)
Updates the container. |
void |
validate()
Validates this container and all of its subcomponents. |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setLayout, validateTree |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Window(Frame parent)
The window is not initially visible. Call the show
method to cause the window to become visible.
parent - the main application frame.
UnsupportedOperationException - if the implementation does
not allow the direct creation of window objects.show(),
Component.setSize(int, int)| Method Detail |
|---|
public void pack()
public Graphics getGraphics()
null if this component is currently not on
the screen.
getGraphics in class Componentnull
if it has none.Component.paint(java.awt.Graphics)public void validate()
Container
AWT uses validate to cause a container to lay out
its subcomponents again after the components it contains
have been added to or modified.
validate in class ContainerContainer.validate(),
Component.invalidate()public void update(Graphics g)
Container
update in class Containerg - the specified Graphics windowComponent.update(java.awt.Graphics)public void show()
If this window is not yet visible, show
makes it visible. If this window is already visible,
then this method brings it to the front.
show in class ComponenttoFront(),
Component.setVisible(boolean)public void dispose()
public void toFront()
toBack()public void toBack()
toFront()public Toolkit getToolkit()
getToolkit in class ComponentToolkit,
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.
getLocale in class ComponentLocalepublic java.awt.Insets getInsets()
Container
A Frame object, for example, has a top inset that
corresponds to the height of the frame's title bar.
getInsets in class ContainerInsets,
LayoutManagerpublic void setBackground(java.awt.Color c)
Component
setBackground in class ComponentComponent.getBackground()public void setCursor(java.awt.Cursor cursor)
setCursor in class Componentcursor - 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(),
Cursorpublic void addWindowListener(java.awt.event.WindowListener l)
l - the window listenerpublic void removeWindowListener(java.awt.event.WindowListener l)
l - the window listenerprotected void processEvent(AWTEvent e)
processEvent in class Containere - the eventComponent.processComponentEvent(java.awt.event.ComponentEvent),
Component.processFocusEvent(java.awt.event.FocusEvent),
Component.processKeyEvent(java.awt.event.KeyEvent),
Component.processMouseEvent(java.awt.event.MouseEvent),
Component.processMouseMotionEvent(java.awt.event.MouseEvent)protected void processWindowEvent(java.awt.event.WindowEvent e)
e - the window eventComponent.enableEvents(long)
public void repaint(long tm,
int x,
int y,
int width,
int height)
Componenttm milliseconds.
This method causes a call to this component's
update method.
repaint in class Componenttm - maximum time in milliseconds before update.x - the x coordinate.y - the y coordinate.width - the width.height - the height.Component.update(java.awt.Graphics)public Component getFocusOwner()
public boolean postEvent(Event e)
dispatchEvent(AWTEvent).
postEvent in interface MenuContainerpostEvent in class Componentpublic boolean isShowing()
isShowing in class Componenttrue if the component is showing;
false otherwise.Component.setVisible(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||