Java java.awt Window fields, constructors, methods, implement or subclass

Example usage for Java java.awt Window fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt Window.

The text is from its open source code.

Subclass

java.awt.Window has subclasses.
Click this link to see all its subclasses.

Constructor

Window(GraphicsConfiguration gc)
Constructs a new, initially invisible window in default size with the specified GraphicsConfiguration .
Window(Frame owner)
Constructs a new, initially invisible window with the specified Frame as its owner.
Window(Window owner)
Constructs a new, initially invisible window with the specified Window as its owner.

Method

Componentadd(String name, Component comp)
Adds the specified component to this container.
Componentadd(Component comp)
Appends the specified component to the end of this container.
voidaddComponentListener(ComponentListener l)
Adds the specified component listener to receive component events from this component.
voidaddMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.
voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list for a specific property.
voidaddWindowFocusListener(WindowFocusListener l)
Adds the specified window focus listener to receive window events from this window.
voidaddWindowListener(WindowListener l)
Adds the specified window listener to receive window events from this window.
voiddispatchEvent(AWTEvent e)
Dispatches an event to this component or one of its sub components.
voiddispose()
Releases all of the native screen resources used by this Window , its subcomponents, and all of its owned children.
RectanglegetBounds()
Gets the bounds of this component in the form of a Rectangle object.
BufferStrategygetBufferStrategy()
Returns the BufferStrategy used by this component.
ClassgetClass()
Returns the runtime class of this Object .
ComponentListener[]getComponentListeners()
Returns an array of all the component listeners registered on this component.
CursorgetCursor()
Gets the cursor set in the component.
booleangetFocusableWindowState()
Returns whether this Window can become the focused Window if it meets the other requirements outlined in isFocusableWindow .
GraphicsConfigurationgetGraphicsConfiguration()
Gets the GraphicsConfiguration associated with this Component .
intgetHeight()
Returns the current height of this component.
InsetsgetInsets()
Determines the insets of this container, which indicate the size of the container's border.
PointgetLocation()
Gets the location of this component in the form of a point specifying the component's top-left corner.
PointgetLocationOnScreen()
Gets the location of this component in the form of a point specifying the component's top-left corner in the screen's coordinate space.
StringgetName()
Gets the name of the component.
Window[]getOwnedWindows()
Return an array containing all the windows this window currently owns.
WindowgetOwner()
Returns the owner of this window.
Window[]getOwnerlessWindows()
Returns an array of all Window s created by this application that have no owner.
ContainergetParent()
Gets the parent of this component.
DimensiongetPreferredSize()
Returns the preferred size of this container.
DimensiongetSize()
Returns the size of this component in the form of a Dimension object.
ToolkitgetToolkit()
Returns the toolkit of this frame.
intgetWidth()
Returns the current width of this component.
WindowListener[]getWindowListeners()
Returns an array of all the window listeners registered on this window.
Window[]getWindows()
Returns an array of all Window s, both owned and ownerless, created by this application.
intgetX()
Returns the current x coordinate of the components origin.
intgetY()
Returns the current y coordinate of the components origin.
booleanisActive()
Returns whether this Window is active.
booleanisAlwaysOnTop()
Returns whether this window is an always-on-top window.
booleanisFocused()
Returns whether this Window is focused.
booleanisShowing()
Checks if this Window is showing on screen.
booleanisVisible()
Determines whether this component should be visible when its parent is visible.
voidpack()
Causes this Window to be sized to fit the preferred size and layouts of its subcomponents.
voidremove(int index)
Removes the component, specified by index , from this container.
voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list for a specific property.
voidremoveWindowListener(WindowListener l)
Removes the specified window listener so that it no longer receives window events from this window.
voidrepaint()
Repaints this component.
voidrequestFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
booleanrequestFocusInWindow()
Requests that this Component get the input focus, if this Component's top-level ancestor is already the focused Window.
voidsetAlwaysOnTop(boolean alwaysOnTop)
Sets whether this window should always be above other windows.
voidsetBackground(Color bgColor)
Sets the background color of this window.
voidsetBounds(int x, int y, int width, int height)

The width or height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetBounds(Rectangle r)

The r.width or r.height values will be automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetCursor(Cursor cursor)
Set the cursor image to a specified cursor.
voidsetFocusableWindowState(boolean focusableWindowState)
Sets whether this Window can become the focused Window if it meets the other requirements outlined in isFocusableWindow .
voidsetFont(Font f)
Sets the font of this container.
voidsetForeground(Color c)
Sets the foreground color of this component.
voidsetIconImage(Image image)
Sets the image to be displayed as the icon for this window.
voidsetLocation(int x, int y)

The method changes the geometry-related data.

voidsetLocation(Point p)

The method changes the geometry-related data.

voidsetLocationByPlatform(boolean locationByPlatform)
Sets whether this Window should appear at the default location for the native windowing system or at the current location (returned by getLocation ) the next time the Window is made visible.
voidsetLocationRelativeTo(Component c)
Sets the location of the window relative to the specified component according to the following scenarios.
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this window to a constant value.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component to a constant value.
voidsetSize(Dimension d)

The d.width and d.height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetSize(int width, int height)

The width and height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

voidsetVisible(boolean b)
Shows or hides this Window depending on the value of parameter b .
voidtoBack()
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.
voidtoFront()
If this Window is visible, brings this Window to the front and may make it the focused Window.
voidvalidate()
Validates this container and all of its subcomponents.