JWindow (Java SE 15 & JDK 15) (original) (raw)
All Implemented Interfaces:
[ImageObserver](../../java/awt/image/ImageObserver.html "interface in java.awt.image")
, [MenuContainer](../../java/awt/MenuContainer.html "interface in java.awt")
, [Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")
, [Accessible](../accessibility/Accessible.html "interface in javax.accessibility")
, [RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
@JavaBean(defaultProperty="accessibleContext", description="A toplevel window which has no system border or controls.") public class JWindow extends Window implements Accessible, RootPaneContainer
A JWindow
is a container that can be displayed anywhere on the user's desktop. It does not have the title bar, window-management buttons, or other trimmings associated with a JFrame
, but it is still a "first-class citizen" of the user's desktop, and can exist anywhere on it.
The JWindow
component contains a JRootPane
as its only child. The contentPane
should be the parent of any children of the JWindow
. As a convenience, the add
, remove
, and setLayout
methods of this class are overridden, so that they delegate calls to the corresponding methods of the ContentPane
. For example, you can add a child component to a window as follows:
window.add(child);
And the child will be added to the contentPane. The contentPane
will always be non-null
. Attempting to set it to null
will cause the JWindow
to throw an exception. The default contentPane
will have aBorderLayout
manager set on it. Refer to RootPaneContainer for details on adding, removing and setting the LayoutManager
of a JWindow
.
Please see the JRootPane documentation for a complete description of the contentPane
, glassPane
, andlayeredPane
components.
In a multi-screen environment, you can create a JWindow
on a different screen device. See Window for more information.
Warning: Swing is not thread safe. For more information see Swing's Threading Policy.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans
package. Please see XMLEncoder.
Since:
1.2
See Also:
Nested Class Summary
Nested Classes
Modifier and Type | Class | Description |
---|---|---|
protected class | JWindow.AccessibleJWindow | This class implements accessibility support for theJWindow class. |
Field Summary
Fields
Modifier and Type | Field | Description |
---|---|---|
protected AccessibleContext | accessibleContext | The accessible context property. |
protected JRootPane | rootPane | The JRootPane instance that manages thecontentPane and optional menuBar for this frame, as well as theglassPane. |
protected boolean | rootPaneCheckingEnabled | If true then calls to add and setLayout will be forwarded to the contentPane. |
Constructor Summary
Constructors
Constructor | Description |
---|---|
JWindow() | Creates a window with no specified owner. |
JWindow(Frame owner) | Creates a window with the specified owner frame. |
JWindow(GraphicsConfiguration gc) | Creates a window with the specified GraphicsConfiguration of a screen device. |
JWindow(Window owner) | Creates a window with the specified owner window. |
JWindow(Window owner,GraphicsConfiguration gc) | Creates a window with the specified owner window andGraphicsConfiguration of a screen device. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
protected void | addImpl(Component comp,Object constraints, int index) | Adds the specified child Component. |
protected JRootPane | createRootPane() | Called by the constructor methods to create the defaultrootPane. |
AccessibleContext | getAccessibleContext() | Gets the AccessibleContext associated with this JWindow. |
Container | getContentPane() | Returns the Container which is the contentPane for this window. |
Component | getGlassPane() | Returns the glassPane Component for this window. |
Graphics | getGraphics() | Creates a graphics context for this component. |
JLayeredPane | getLayeredPane() | Returns the layeredPane object for this window. |
JRootPane | getRootPane() | Returns the rootPane object for this window. |
TransferHandler | getTransferHandler() | Gets the transferHandler property. |
protected boolean | isRootPaneCheckingEnabled() | Returns whether calls to add andsetLayout are forwarded to the contentPane. |
protected String | paramString() | Returns a string representation of this JWindow. |
void | remove(Component comp) | Removes the specified component from the container. |
void | repaint(long time, int x, int y, int width, int height) | Repaints the specified rectangle of this component withintime milliseconds. |
void | setContentPane(Container contentPane) | Sets the contentPane property for this window. |
void | setGlassPane(Component glassPane) | Sets the glassPane property. |
void | setLayeredPane(JLayeredPane layeredPane) | Sets the layeredPane property. |
void | setLayout(LayoutManager manager) | Sets the LayoutManager. |
protected void | setRootPane(JRootPane root) | Sets the new rootPane object for this window. |
protected void | setRootPaneCheckingEnabled(boolean enabled) | Sets whether calls to add andsetLayout are forwarded to the contentPane. |
void | setTransferHandler(TransferHandler newHandler) | Sets the transferHandler property, which is a mechanism to support transfer of data into this component. |
void | update(Graphics g) | Calls paint(g). |
protected void | windowInit() | Called by the constructors to init the JWindow properly. |
Methods declared in class java.awt.Window
[addNotify](../../java/awt/Window.html#addNotify%28%29), [addPropertyChangeListener](../../java/awt/Window.html#addPropertyChangeListener%28java.beans.PropertyChangeListener%29), [addPropertyChangeListener](../../java/awt/Window.html#addPropertyChangeListener%28java.lang.String,java.beans.PropertyChangeListener%29), [addWindowFocusListener](../../java/awt/Window.html#addWindowFocusListener%28java.awt.event.WindowFocusListener%29), [addWindowListener](../../java/awt/Window.html#addWindowListener%28java.awt.event.WindowListener%29), [addWindowStateListener](../../java/awt/Window.html#addWindowStateListener%28java.awt.event.WindowStateListener%29), [applyResourceBundle](../../java/awt/Window.html#applyResourceBundle%28java.lang.String%29), [applyResourceBundle](../../java/awt/Window.html#applyResourceBundle%28java.util.ResourceBundle%29), [createBufferStrategy](../../java/awt/Window.html#createBufferStrategy%28int%29), [createBufferStrategy](../../java/awt/Window.html#createBufferStrategy%28int,java.awt.BufferCapabilities%29), [dispose](../../java/awt/Window.html#dispose%28%29), [getBackground](../../java/awt/Window.html#getBackground%28%29), [getBufferStrategy](../../java/awt/Window.html#getBufferStrategy%28%29), [getFocusableWindowState](../../java/awt/Window.html#getFocusableWindowState%28%29), [getFocusCycleRootAncestor](../../java/awt/Window.html#getFocusCycleRootAncestor%28%29), [getFocusOwner](../../java/awt/Window.html#getFocusOwner%28%29), [getFocusTraversalKeys](../../java/awt/Window.html#getFocusTraversalKeys%28int%29), [getIconImages](../../java/awt/Window.html#getIconImages%28%29), [getInputContext](../../java/awt/Window.html#getInputContext%28%29), [getListeners](../../java/awt/Window.html#getListeners%28java.lang.Class%29), [getLocale](../../java/awt/Window.html#getLocale%28%29), [getModalExclusionType](../../java/awt/Window.html#getModalExclusionType%28%29), [getMostRecentFocusOwner](../../java/awt/Window.html#getMostRecentFocusOwner%28%29), [getOpacity](../../java/awt/Window.html#getOpacity%28%29), [getOwnedWindows](../../java/awt/Window.html#getOwnedWindows%28%29), [getOwner](../../java/awt/Window.html#getOwner%28%29), [getOwnerlessWindows](../../java/awt/Window.html#getOwnerlessWindows%28%29), [getShape](../../java/awt/Window.html#getShape%28%29), [getToolkit](../../java/awt/Window.html#getToolkit%28%29), [getType](../../java/awt/Window.html#getType%28%29), [getWarningString](../../java/awt/Window.html#getWarningString%28%29), [getWindowFocusListeners](../../java/awt/Window.html#getWindowFocusListeners%28%29), [getWindowListeners](../../java/awt/Window.html#getWindowListeners%28%29), [getWindows](../../java/awt/Window.html#getWindows%28%29), [getWindowStateListeners](../../java/awt/Window.html#getWindowStateListeners%28%29), [hide](../../java/awt/Window.html#hide%28%29), [isActive](../../java/awt/Window.html#isActive%28%29), [isAlwaysOnTop](../../java/awt/Window.html#isAlwaysOnTop%28%29), [isAlwaysOnTopSupported](../../java/awt/Window.html#isAlwaysOnTopSupported%28%29), [isAutoRequestFocus](../../java/awt/Window.html#isAutoRequestFocus%28%29), [isFocusableWindow](../../java/awt/Window.html#isFocusableWindow%28%29), [isFocusCycleRoot](../../java/awt/Window.html#isFocusCycleRoot%28%29), [isFocused](../../java/awt/Window.html#isFocused%28%29), [isLocationByPlatform](../../java/awt/Window.html#isLocationByPlatform%28%29), [isOpaque](../../java/awt/Window.html#isOpaque%28%29), [isShowing](../../java/awt/Window.html#isShowing%28%29), [isValidateRoot](../../java/awt/Window.html#isValidateRoot%28%29), [pack](../../java/awt/Window.html#pack%28%29), [paint](../../java/awt/Window.html#paint%28java.awt.Graphics%29), [postEvent](../../java/awt/Window.html#postEvent%28java.awt.Event%29), [processEvent](../../java/awt/Window.html#processEvent%28java.awt.AWTEvent%29), [processWindowEvent](../../java/awt/Window.html#processWindowEvent%28java.awt.event.WindowEvent%29), [processWindowFocusEvent](../../java/awt/Window.html#processWindowFocusEvent%28java.awt.event.WindowEvent%29), [processWindowStateEvent](../../java/awt/Window.html#processWindowStateEvent%28java.awt.event.WindowEvent%29), [removeWindowFocusListener](../../java/awt/Window.html#removeWindowFocusListener%28java.awt.event.WindowFocusListener%29), [removeWindowListener](../../java/awt/Window.html#removeWindowListener%28java.awt.event.WindowListener%29), [removeWindowStateListener](../../java/awt/Window.html#removeWindowStateListener%28java.awt.event.WindowStateListener%29), [reshape](../../java/awt/Window.html#reshape%28int,int,int,int%29), [setAlwaysOnTop](../../java/awt/Window.html#setAlwaysOnTop%28boolean%29), [setAutoRequestFocus](../../java/awt/Window.html#setAutoRequestFocus%28boolean%29), [setBackground](../../java/awt/Window.html#setBackground%28java.awt.Color%29), [setBounds](../../java/awt/Window.html#setBounds%28int,int,int,int%29), [setBounds](../../java/awt/Window.html#setBounds%28java.awt.Rectangle%29), [setCursor](../../java/awt/Window.html#setCursor%28java.awt.Cursor%29), [setFocusableWindowState](../../java/awt/Window.html#setFocusableWindowState%28boolean%29), [setFocusCycleRoot](../../java/awt/Window.html#setFocusCycleRoot%28boolean%29), [setIconImage](../../java/awt/Window.html#setIconImage%28java.awt.Image%29), [setIconImages](../../java/awt/Window.html#setIconImages%28java.util.List%29), [setLocation](../../java/awt/Window.html#setLocation%28int,int%29), [setLocation](../../java/awt/Window.html#setLocation%28java.awt.Point%29), [setLocationByPlatform](../../java/awt/Window.html#setLocationByPlatform%28boolean%29), [setLocationRelativeTo](../../java/awt/Window.html#setLocationRelativeTo%28java.awt.Component%29), [setMinimumSize](../../java/awt/Window.html#setMinimumSize%28java.awt.Dimension%29), [setModalExclusionType](../../java/awt/Window.html#setModalExclusionType%28java.awt.Dialog.ModalExclusionType%29), [setOpacity](../../java/awt/Window.html#setOpacity%28float%29), [setShape](../../java/awt/Window.html#setShape%28java.awt.Shape%29), [setSize](../../java/awt/Window.html#setSize%28int,int%29), [setSize](../../java/awt/Window.html#setSize%28java.awt.Dimension%29), [setType](../../java/awt/Window.html#setType%28java.awt.Window.Type%29), [setVisible](../../java/awt/Window.html#setVisible%28boolean%29), [show](../../java/awt/Window.html#show%28%29), [toBack](../../java/awt/Window.html#toBack%28%29), [toFront](../../java/awt/Window.html#toFront%28%29)
Methods declared in class java.awt.Container
[add](../../java/awt/Container.html#add%28java.awt.Component%29), [add](../../java/awt/Container.html#add%28java.awt.Component,int%29), [add](../../java/awt/Container.html#add%28java.awt.Component,java.lang.Object%29), [add](../../java/awt/Container.html#add%28java.awt.Component,java.lang.Object,int%29), [add](../../java/awt/Container.html#add%28java.lang.String,java.awt.Component%29), [addContainerListener](../../java/awt/Container.html#addContainerListener%28java.awt.event.ContainerListener%29), [applyComponentOrientation](../../java/awt/Container.html#applyComponentOrientation%28java.awt.ComponentOrientation%29), [areFocusTraversalKeysSet](../../java/awt/Container.html#areFocusTraversalKeysSet%28int%29), [countComponents](../../java/awt/Container.html#countComponents%28%29), [deliverEvent](../../java/awt/Container.html#deliverEvent%28java.awt.Event%29), [doLayout](../../java/awt/Container.html#doLayout%28%29), [findComponentAt](../../java/awt/Container.html#findComponentAt%28int,int%29), [findComponentAt](../../java/awt/Container.html#findComponentAt%28java.awt.Point%29), [getAlignmentX](../../java/awt/Container.html#getAlignmentX%28%29), [getAlignmentY](../../java/awt/Container.html#getAlignmentY%28%29), [getComponent](../../java/awt/Container.html#getComponent%28int%29), [getComponentAt](../../java/awt/Container.html#getComponentAt%28int,int%29), [getComponentAt](../../java/awt/Container.html#getComponentAt%28java.awt.Point%29), [getComponentCount](../../java/awt/Container.html#getComponentCount%28%29), [getComponents](../../java/awt/Container.html#getComponents%28%29), [getComponentZOrder](../../java/awt/Container.html#getComponentZOrder%28java.awt.Component%29), [getContainerListeners](../../java/awt/Container.html#getContainerListeners%28%29), [getFocusTraversalPolicy](../../java/awt/Container.html#getFocusTraversalPolicy%28%29), [getInsets](../../java/awt/Container.html#getInsets%28%29), [getLayout](../../java/awt/Container.html#getLayout%28%29), [getMaximumSize](../../java/awt/Container.html#getMaximumSize%28%29), [getMinimumSize](../../java/awt/Container.html#getMinimumSize%28%29), [getMousePosition](../../java/awt/Container.html#getMousePosition%28boolean%29), [getPreferredSize](../../java/awt/Container.html#getPreferredSize%28%29), [insets](../../java/awt/Container.html#insets%28%29), [invalidate](../../java/awt/Container.html#invalidate%28%29), [isAncestorOf](../../java/awt/Container.html#isAncestorOf%28java.awt.Component%29), [isFocusCycleRoot](../../java/awt/Container.html#isFocusCycleRoot%28java.awt.Container%29), [isFocusTraversalPolicyProvider](../../java/awt/Container.html#isFocusTraversalPolicyProvider%28%29), [isFocusTraversalPolicySet](../../java/awt/Container.html#isFocusTraversalPolicySet%28%29), [layout](../../java/awt/Container.html#layout%28%29), [list](../../java/awt/Container.html#list%28java.io.PrintStream,int%29), [list](../../java/awt/Container.html#list%28java.io.PrintWriter,int%29), [locate](../../java/awt/Container.html#locate%28int,int%29), [minimumSize](../../java/awt/Container.html#minimumSize%28%29), [paintComponents](../../java/awt/Container.html#paintComponents%28java.awt.Graphics%29), [preferredSize](../../java/awt/Container.html#preferredSize%28%29), [print](../../java/awt/Container.html#print%28java.awt.Graphics%29), [printComponents](../../java/awt/Container.html#printComponents%28java.awt.Graphics%29), [processContainerEvent](../../java/awt/Container.html#processContainerEvent%28java.awt.event.ContainerEvent%29), [remove](../../java/awt/Container.html#remove%28int%29), [removeAll](../../java/awt/Container.html#removeAll%28%29), [removeContainerListener](../../java/awt/Container.html#removeContainerListener%28java.awt.event.ContainerListener%29), [removeNotify](../../java/awt/Container.html#removeNotify%28%29), [setComponentZOrder](../../java/awt/Container.html#setComponentZOrder%28java.awt.Component,int%29), [setFocusTraversalKeys](../../java/awt/Container.html#setFocusTraversalKeys%28int,java.util.Set%29), [setFocusTraversalPolicy](../../java/awt/Container.html#setFocusTraversalPolicy%28java.awt.FocusTraversalPolicy%29), [setFocusTraversalPolicyProvider](../../java/awt/Container.html#setFocusTraversalPolicyProvider%28boolean%29), [setFont](../../java/awt/Container.html#setFont%28java.awt.Font%29), [transferFocusDownCycle](../../java/awt/Container.html#transferFocusDownCycle%28%29), [validate](../../java/awt/Container.html#validate%28%29), [validateTree](../../java/awt/Container.html#validateTree%28%29)
Methods declared in class java.awt.Component
[action](../../java/awt/Component.html#action%28java.awt.Event,java.lang.Object%29), [add](../../java/awt/Component.html#add%28java.awt.PopupMenu%29), [addComponentListener](../../java/awt/Component.html#addComponentListener%28java.awt.event.ComponentListener%29), [addFocusListener](../../java/awt/Component.html#addFocusListener%28java.awt.event.FocusListener%29), [addHierarchyBoundsListener](../../java/awt/Component.html#addHierarchyBoundsListener%28java.awt.event.HierarchyBoundsListener%29), [addHierarchyListener](../../java/awt/Component.html#addHierarchyListener%28java.awt.event.HierarchyListener%29), [addInputMethodListener](../../java/awt/Component.html#addInputMethodListener%28java.awt.event.InputMethodListener%29), [addKeyListener](../../java/awt/Component.html#addKeyListener%28java.awt.event.KeyListener%29), [addMouseListener](../../java/awt/Component.html#addMouseListener%28java.awt.event.MouseListener%29), [addMouseMotionListener](../../java/awt/Component.html#addMouseMotionListener%28java.awt.event.MouseMotionListener%29), [addMouseWheelListener](../../java/awt/Component.html#addMouseWheelListener%28java.awt.event.MouseWheelListener%29), [bounds](../../java/awt/Component.html#bounds%28%29), [checkImage](../../java/awt/Component.html#checkImage%28java.awt.Image,int,int,java.awt.image.ImageObserver%29), [checkImage](../../java/awt/Component.html#checkImage%28java.awt.Image,java.awt.image.ImageObserver%29), [coalesceEvents](../../java/awt/Component.html#coalesceEvents%28java.awt.AWTEvent,java.awt.AWTEvent%29), [contains](../../java/awt/Component.html#contains%28int,int%29), [contains](../../java/awt/Component.html#contains%28java.awt.Point%29), [createImage](../../java/awt/Component.html#createImage%28int,int%29), [createImage](../../java/awt/Component.html#createImage%28java.awt.image.ImageProducer%29), [createVolatileImage](../../java/awt/Component.html#createVolatileImage%28int,int%29), [createVolatileImage](../../java/awt/Component.html#createVolatileImage%28int,int,java.awt.ImageCapabilities%29), [disable](../../java/awt/Component.html#disable%28%29), [disableEvents](../../java/awt/Component.html#disableEvents%28long%29), [dispatchEvent](../../java/awt/Component.html#dispatchEvent%28java.awt.AWTEvent%29), [enable](../../java/awt/Component.html#enable%28%29), [enable](../../java/awt/Component.html#enable%28boolean%29), [enableEvents](../../java/awt/Component.html#enableEvents%28long%29), [enableInputMethods](../../java/awt/Component.html#enableInputMethods%28boolean%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,boolean,boolean%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,byte,byte%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,char,char%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,double,double%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,float,float%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,int,int%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,long,long%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,short,short%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,java.lang.Object,java.lang.Object%29), [getBaseline](../../java/awt/Component.html#getBaseline%28int,int%29), [getBaselineResizeBehavior](../../java/awt/Component.html#getBaselineResizeBehavior%28%29), [getBounds](../../java/awt/Component.html#getBounds%28%29), [getBounds](../../java/awt/Component.html#getBounds%28java.awt.Rectangle%29), [getColorModel](../../java/awt/Component.html#getColorModel%28%29), [getComponentListeners](../../java/awt/Component.html#getComponentListeners%28%29), [getComponentOrientation](../../java/awt/Component.html#getComponentOrientation%28%29), [getCursor](../../java/awt/Component.html#getCursor%28%29), [getDropTarget](../../java/awt/Component.html#getDropTarget%28%29), [getFocusListeners](../../java/awt/Component.html#getFocusListeners%28%29), [getFocusTraversalKeysEnabled](../../java/awt/Component.html#getFocusTraversalKeysEnabled%28%29), [getFont](../../java/awt/Component.html#getFont%28%29), [getFontMetrics](../../java/awt/Component.html#getFontMetrics%28java.awt.Font%29), [getForeground](../../java/awt/Component.html#getForeground%28%29), [getGraphicsConfiguration](../../java/awt/Component.html#getGraphicsConfiguration%28%29), [getHeight](../../java/awt/Component.html#getHeight%28%29), [getHierarchyBoundsListeners](../../java/awt/Component.html#getHierarchyBoundsListeners%28%29), [getHierarchyListeners](../../java/awt/Component.html#getHierarchyListeners%28%29), [getIgnoreRepaint](../../java/awt/Component.html#getIgnoreRepaint%28%29), [getInputMethodListeners](../../java/awt/Component.html#getInputMethodListeners%28%29), [getInputMethodRequests](../../java/awt/Component.html#getInputMethodRequests%28%29), [getKeyListeners](../../java/awt/Component.html#getKeyListeners%28%29), [getLocation](../../java/awt/Component.html#getLocation%28%29), [getLocation](../../java/awt/Component.html#getLocation%28java.awt.Point%29), [getLocationOnScreen](../../java/awt/Component.html#getLocationOnScreen%28%29), [getMouseListeners](../../java/awt/Component.html#getMouseListeners%28%29), [getMouseMotionListeners](../../java/awt/Component.html#getMouseMotionListeners%28%29), [getMousePosition](../../java/awt/Component.html#getMousePosition%28%29), [getMouseWheelListeners](../../java/awt/Component.html#getMouseWheelListeners%28%29), [getName](../../java/awt/Component.html#getName%28%29), [getParent](../../java/awt/Component.html#getParent%28%29), [getPropertyChangeListeners](../../java/awt/Component.html#getPropertyChangeListeners%28%29), [getPropertyChangeListeners](../../java/awt/Component.html#getPropertyChangeListeners%28java.lang.String%29), [getSize](../../java/awt/Component.html#getSize%28%29), [getSize](../../java/awt/Component.html#getSize%28java.awt.Dimension%29), [getTreeLock](../../java/awt/Component.html#getTreeLock%28%29), [getWidth](../../java/awt/Component.html#getWidth%28%29), [getX](../../java/awt/Component.html#getX%28%29), [getY](../../java/awt/Component.html#getY%28%29), [gotFocus](../../java/awt/Component.html#gotFocus%28java.awt.Event,java.lang.Object%29), [handleEvent](../../java/awt/Component.html#handleEvent%28java.awt.Event%29), [hasFocus](../../java/awt/Component.html#hasFocus%28%29), [imageUpdate](../../java/awt/Component.html#imageUpdate%28java.awt.Image,int,int,int,int,int%29), [inside](../../java/awt/Component.html#inside%28int,int%29), [isBackgroundSet](../../java/awt/Component.html#isBackgroundSet%28%29), [isCursorSet](../../java/awt/Component.html#isCursorSet%28%29), [isDisplayable](../../java/awt/Component.html#isDisplayable%28%29), [isDoubleBuffered](../../java/awt/Component.html#isDoubleBuffered%28%29), [isEnabled](../../java/awt/Component.html#isEnabled%28%29), [isFocusable](../../java/awt/Component.html#isFocusable%28%29), [isFocusOwner](../../java/awt/Component.html#isFocusOwner%28%29), [isFocusTraversable](../../java/awt/Component.html#isFocusTraversable%28%29), [isFontSet](../../java/awt/Component.html#isFontSet%28%29), [isForegroundSet](../../java/awt/Component.html#isForegroundSet%28%29), [isLightweight](../../java/awt/Component.html#isLightweight%28%29), [isMaximumSizeSet](../../java/awt/Component.html#isMaximumSizeSet%28%29), [isMinimumSizeSet](../../java/awt/Component.html#isMinimumSizeSet%28%29), [isPreferredSizeSet](../../java/awt/Component.html#isPreferredSizeSet%28%29), [isValid](../../java/awt/Component.html#isValid%28%29), [isVisible](../../java/awt/Component.html#isVisible%28%29), [keyDown](../../java/awt/Component.html#keyDown%28java.awt.Event,int%29), [keyUp](../../java/awt/Component.html#keyUp%28java.awt.Event,int%29), [list](../../java/awt/Component.html#list%28%29), [list](../../java/awt/Component.html#list%28java.io.PrintStream%29), [list](../../java/awt/Component.html#list%28java.io.PrintWriter%29), [location](../../java/awt/Component.html#location%28%29), [lostFocus](../../java/awt/Component.html#lostFocus%28java.awt.Event,java.lang.Object%29), [mouseDown](../../java/awt/Component.html#mouseDown%28java.awt.Event,int,int%29), [mouseDrag](../../java/awt/Component.html#mouseDrag%28java.awt.Event,int,int%29), [mouseEnter](../../java/awt/Component.html#mouseEnter%28java.awt.Event,int,int%29), [mouseExit](../../java/awt/Component.html#mouseExit%28java.awt.Event,int,int%29), [mouseMove](../../java/awt/Component.html#mouseMove%28java.awt.Event,int,int%29), [mouseUp](../../java/awt/Component.html#mouseUp%28java.awt.Event,int,int%29), [move](../../java/awt/Component.html#move%28int,int%29), [nextFocus](../../java/awt/Component.html#nextFocus%28%29), [paintAll](../../java/awt/Component.html#paintAll%28java.awt.Graphics%29), [prepareImage](../../java/awt/Component.html#prepareImage%28java.awt.Image,int,int,java.awt.image.ImageObserver%29), [prepareImage](../../java/awt/Component.html#prepareImage%28java.awt.Image,java.awt.image.ImageObserver%29), [printAll](../../java/awt/Component.html#printAll%28java.awt.Graphics%29), [processComponentEvent](../../java/awt/Component.html#processComponentEvent%28java.awt.event.ComponentEvent%29), [processFocusEvent](../../java/awt/Component.html#processFocusEvent%28java.awt.event.FocusEvent%29), [processHierarchyBoundsEvent](../../java/awt/Component.html#processHierarchyBoundsEvent%28java.awt.event.HierarchyEvent%29), [processHierarchyEvent](../../java/awt/Component.html#processHierarchyEvent%28java.awt.event.HierarchyEvent%29), [processInputMethodEvent](../../java/awt/Component.html#processInputMethodEvent%28java.awt.event.InputMethodEvent%29), [processKeyEvent](../../java/awt/Component.html#processKeyEvent%28java.awt.event.KeyEvent%29), [processMouseEvent](../../java/awt/Component.html#processMouseEvent%28java.awt.event.MouseEvent%29), [processMouseMotionEvent](../../java/awt/Component.html#processMouseMotionEvent%28java.awt.event.MouseEvent%29), [processMouseWheelEvent](../../java/awt/Component.html#processMouseWheelEvent%28java.awt.event.MouseWheelEvent%29), [remove](../../java/awt/Component.html#remove%28java.awt.MenuComponent%29), [removeComponentListener](../../java/awt/Component.html#removeComponentListener%28java.awt.event.ComponentListener%29), [removeFocusListener](../../java/awt/Component.html#removeFocusListener%28java.awt.event.FocusListener%29), [removeHierarchyBoundsListener](../../java/awt/Component.html#removeHierarchyBoundsListener%28java.awt.event.HierarchyBoundsListener%29), [removeHierarchyListener](../../java/awt/Component.html#removeHierarchyListener%28java.awt.event.HierarchyListener%29), [removeInputMethodListener](../../java/awt/Component.html#removeInputMethodListener%28java.awt.event.InputMethodListener%29), [removeKeyListener](../../java/awt/Component.html#removeKeyListener%28java.awt.event.KeyListener%29), [removeMouseListener](../../java/awt/Component.html#removeMouseListener%28java.awt.event.MouseListener%29), [removeMouseMotionListener](../../java/awt/Component.html#removeMouseMotionListener%28java.awt.event.MouseMotionListener%29), [removeMouseWheelListener](../../java/awt/Component.html#removeMouseWheelListener%28java.awt.event.MouseWheelListener%29), [removePropertyChangeListener](../../java/awt/Component.html#removePropertyChangeListener%28java.beans.PropertyChangeListener%29), [removePropertyChangeListener](../../java/awt/Component.html#removePropertyChangeListener%28java.lang.String,java.beans.PropertyChangeListener%29), [repaint](../../java/awt/Component.html#repaint%28%29), [repaint](../../java/awt/Component.html#repaint%28int,int,int,int%29), [repaint](../../java/awt/Component.html#repaint%28long%29), [requestFocus](../../java/awt/Component.html#requestFocus%28%29), [requestFocus](../../java/awt/Component.html#requestFocus%28boolean%29), [requestFocus](../../java/awt/Component.html#requestFocus%28boolean,java.awt.event.FocusEvent.Cause%29), [requestFocus](../../java/awt/Component.html#requestFocus%28java.awt.event.FocusEvent.Cause%29), [requestFocusInWindow](../../java/awt/Component.html#requestFocusInWindow%28%29), [requestFocusInWindow](../../java/awt/Component.html#requestFocusInWindow%28boolean%29), [requestFocusInWindow](../../java/awt/Component.html#requestFocusInWindow%28java.awt.event.FocusEvent.Cause%29), [resize](../../java/awt/Component.html#resize%28int,int%29), [resize](../../java/awt/Component.html#resize%28java.awt.Dimension%29), [revalidate](../../java/awt/Component.html#revalidate%28%29), [setComponentOrientation](../../java/awt/Component.html#setComponentOrientation%28java.awt.ComponentOrientation%29), [setDropTarget](../../java/awt/Component.html#setDropTarget%28java.awt.dnd.DropTarget%29), [setEnabled](../../java/awt/Component.html#setEnabled%28boolean%29), [setFocusable](../../java/awt/Component.html#setFocusable%28boolean%29), [setFocusTraversalKeysEnabled](../../java/awt/Component.html#setFocusTraversalKeysEnabled%28boolean%29), [setForeground](../../java/awt/Component.html#setForeground%28java.awt.Color%29), [setIgnoreRepaint](../../java/awt/Component.html#setIgnoreRepaint%28boolean%29), [setLocale](../../java/awt/Component.html#setLocale%28java.util.Locale%29), [setMaximumSize](../../java/awt/Component.html#setMaximumSize%28java.awt.Dimension%29), [setMixingCutoutShape](../../java/awt/Component.html#setMixingCutoutShape%28java.awt.Shape%29), [setName](../../java/awt/Component.html#setName%28java.lang.String%29), [setPreferredSize](../../java/awt/Component.html#setPreferredSize%28java.awt.Dimension%29), [show](../../java/awt/Component.html#show%28boolean%29), [size](../../java/awt/Component.html#size%28%29), [toString](../../java/awt/Component.html#toString%28%29), [transferFocus](../../java/awt/Component.html#transferFocus%28%29), [transferFocusBackward](../../java/awt/Component.html#transferFocusBackward%28%29), [transferFocusUpCycle](../../java/awt/Component.html#transferFocusUpCycle%28%29)
Field Details
rootPane
The
JRootPane
instance that manages thecontentPane
and optionalmenuBar
for this frame, as well as theglassPane
.
See Also:
getRootPane(), setRootPane(javax.swing.JRootPane)rootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
If true then calls toadd
andsetLayout
will be forwarded to thecontentPane
. This is initially false, but is set to true when theJWindow
is constructed.
See Also:
isRootPaneCheckingEnabled(), setRootPaneCheckingEnabled(boolean), RootPaneContaineraccessibleContext
The accessible context property.
Constructor Details
JWindow
public JWindow()
Creates a window with no specified owner. This window will not be focusable.
This constructor sets the component's locale property to the value returned byJComponent.getDefaultLocale
.
Throws:
[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt")
- ifGraphicsEnvironment.isHeadless()
returns true.
See Also:
GraphicsEnvironment.isHeadless(), Window.isFocusableWindow(), JComponent.getDefaultLocale()JWindow
Creates a window with the specified
GraphicsConfiguration
of a screen device. This window will not be focusable.
This constructor sets the component's locale property to the value returned byJComponent.getDefaultLocale
.
Parameters:
gc
- theGraphicsConfiguration
that is used to construct the new window with; if gc isnull
, the system defaultGraphicsConfiguration
is assumed
Throws:
[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt")
- IfGraphicsEnvironment.isHeadless()
returns true.
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- ifgc
is not from a screen device.
Since:
1.3
See Also:
GraphicsEnvironment.isHeadless(), Window.isFocusableWindow(), JComponent.getDefaultLocale()JWindow
public JWindow(Frame owner)
Creates a window with the specified owner frame. Ifowner
isnull
, the shared owner will be used and this window will not be focusable. Also, this window will not be focusable unless its owner is showing on the screen.
This constructor sets the component's locale property to the value returned byJComponent.getDefaultLocale
.
Parameters:
owner
- the frame from which the window is displayed
Throws:
[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt")
- if GraphicsEnvironment.isHeadless() returns true.
See Also:
GraphicsEnvironment.isHeadless(), Window.isFocusableWindow(), JComponent.getDefaultLocale()JWindow
public JWindow(Window owner)
Creates a window with the specified owner window. This window will not be focusable unless its owner is showing on the screen. Ifowner
isnull
, the shared owner will be used and this window will not be focusable.
This constructor sets the component's locale property to the value returned byJComponent.getDefaultLocale
.
Parameters:
owner
- the window from which the window is displayed
Throws:
[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt")
- ifGraphicsEnvironment.isHeadless()
returns true.
See Also:
GraphicsEnvironment.isHeadless(), Window.isFocusableWindow(), JComponent.getDefaultLocale()JWindow
Creates a window with the specified owner window and
GraphicsConfiguration
of a screen device. Ifowner
isnull
, the shared owner will be used and this window will not be focusable.
This constructor sets the component's locale property to the value returned byJComponent.getDefaultLocale
.
Parameters:
owner
- the window from which the window is displayed
gc
- theGraphicsConfiguration
that is used to construct the new window with; if gc isnull
, the system defaultGraphicsConfiguration
is assumed, unlessowner
is also null, in which case theGraphicsConfiguration
from the shared owner frame will be used.
Throws:
[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt")
- ifGraphicsEnvironment.isHeadless()
returns true.
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- ifgc
is not from a screen device.
Since:
1.3
See Also:
GraphicsEnvironment.isHeadless(), Window.isFocusableWindow(), JComponent.getDefaultLocale()Method Details
windowInit
protected void windowInit()
Called by the constructors to init theJWindow
properly.createRootPane
Called by the constructor methods to create the default
rootPane
.
Returns:
a newJRootPane
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
Returns whether calls toadd
andsetLayout
are forwarded to thecontentPane
.
Returns:
true ifadd
andsetLayout
are forwarded; false otherwise
See Also:
addImpl(java.awt.Component, java.lang.Object, int), setLayout(java.awt.LayoutManager), setRootPaneCheckingEnabled(boolean), RootPaneContainersetTransferHandler
Sets the
transferHandler
property, which is a mechanism to support transfer of data into this component. Usenull
if the component does not support data transfer operations.
If the system propertysuppressSwingDropSupport
isfalse
(the default) and the current drop target on this component is eithernull
or not a user-set drop target, this method will change the drop target as follows: IfnewHandler
isnull
it will clear the drop target. If notnull
it will install a newDropTarget
.
Note: When used withJWindow
,TransferHandler
only provides data import capability, as the data export related methods are currently typed toJComponent
.
Please see How to Use Drag and Drop and Data Transfer, a section in_The Java Tutorial_, for more information.
Parameters:
newHandler
- the newTransferHandler
Since:
1.6
See Also:
TransferHandler, getTransferHandler(), Component.setDropTarget(java.awt.dnd.DropTarget)getTransferHandler
Gets the
transferHandler
property.
Returns:
the value of thetransferHandler
property
Since:
1.6
See Also:
TransferHandler, setTransferHandler(javax.swing.TransferHandler)update
Calls
paint(g)
. This method was overridden to prevent an unnecessary call to clear the background.
Overrides:
[update](../../java/awt/Container.html#update%28java.awt.Graphics%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
g
- theGraphics
context in which to paint
See Also:
Component.update(Graphics)setRootPaneCheckingEnabled
@BeanProperty(hidden=true,description="Whether the add and setLayout methods are forwarded")protected void setRootPaneCheckingEnabled(boolean enabled)
Sets whether calls toadd
andsetLayout
are forwarded to thecontentPane
.
Parameters:
enabled
- true ifadd
andsetLayout
are forwarded, false if they should operate directly on theJWindow
.
See Also:
addImpl(java.awt.Component, java.lang.Object, int), setLayout(java.awt.LayoutManager), isRootPaneCheckingEnabled(), RootPaneContaineraddImpl
protected void addImpl(Component comp,Object constraints, int index)
Adds the specified childComponent
. This method is overridden to conditionally forward calls to thecontentPane
. By default, children are added to thecontentPane
instead of the frame, refer to RootPaneContainer for details.
Overrides:
[addImpl](../../java/awt/Container.html#addImpl%28java.awt.Component,java.lang.Object,int%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
comp
- the component to be enhanced
constraints
- the constraints to be respected
index
- the index
Throws:
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- ifindex
is invalid
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- if adding the container's parent to itself
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- if adding a window to a container
See Also:
setRootPaneCheckingEnabled(boolean), RootPaneContainerremove
Removes the specified component from the container. If
comp
is not therootPane
, this will forward the call to thecontentPane
. This will do nothing ifcomp
is not a child of theJWindow
orcontentPane
.
Overrides:
[remove](../../java/awt/Container.html#remove%28java.awt.Component%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
comp
- the component to be removed
Throws:
[NullPointerException](../../../java.base/java/lang/NullPointerException.html "class in java.lang")
- ifcomp
is null
See Also:
Container.add(java.awt.Component), RootPaneContainersetLayout
Sets the
LayoutManager
. Overridden to conditionally forward the call to thecontentPane
. Refer to RootPaneContainer for more information.
Overrides:
[setLayout](../../java/awt/Container.html#setLayout%28java.awt.LayoutManager%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
manager
- theLayoutManager
See Also:
setRootPaneCheckingEnabled(boolean), RootPaneContainergetRootPane
Returns the
rootPane
object for this window.
Specified by:
[getRootPane](RootPaneContainer.html#getRootPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
therootPane
property for this window
See Also:
setRootPane(javax.swing.JRootPane), RootPaneContainer.getRootPane()setRootPane
protected void setRootPane(JRootPane root)
Sets the newrootPane
object for this window. This method is called by the constructor.
Parameters:
root
- the newrootPane
property
See Also:
getRootPane()getContentPane
Returns the
Container
which is thecontentPane
for this window.
Specified by:
[getContentPane](RootPaneContainer.html#getContentPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
thecontentPane
property
See Also:
setContentPane(java.awt.Container), RootPaneContainer.getContentPane()setContentPane
@BeanProperty(bound=false,hidden=true,description="The client area of the window where child components are normally inserted.")public void setContentPane(Container contentPane)
Sets thecontentPane
property for this window. This method is called by the constructor.
Specified by:
[setContentPane](RootPaneContainer.html#setContentPane%28java.awt.Container%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Parameters:
contentPane
- the newcontentPane
Throws:
[IllegalComponentStateException](../../java/awt/IllegalComponentStateException.html "class in java.awt")
- (a runtime exception) if the content pane parameter isnull
See Also:
getContentPane(), RootPaneContainer.setContentPane(java.awt.Container)getLayeredPane
Returns the
layeredPane
object for this window.
Specified by:
[getLayeredPane](RootPaneContainer.html#getLayeredPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
thelayeredPane
property
See Also:
setLayeredPane(javax.swing.JLayeredPane), RootPaneContainer.getLayeredPane()setLayeredPane
Sets the
layeredPane
property. This method is called by the constructor.
Specified by:
[setLayeredPane](RootPaneContainer.html#setLayeredPane%28javax.swing.JLayeredPane%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Parameters:
layeredPane
- the newlayeredPane
object
Throws:
[IllegalComponentStateException](../../java/awt/IllegalComponentStateException.html "class in java.awt")
- (a runtime exception) if the content pane parameter isnull
See Also:
getLayeredPane(), RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)getGlassPane
Returns the
glassPane Component
for this window.
Specified by:
[getGlassPane](RootPaneContainer.html#getGlassPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
theglassPane
property
See Also:
setGlassPane(java.awt.Component), RootPaneContainer.getGlassPane()setGlassPane
Sets the
glassPane
property. This method is called by the constructor.
Specified by:
[setGlassPane](RootPaneContainer.html#setGlassPane%28java.awt.Component%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Parameters:
glassPane
- theglassPane
object for this window
See Also:
getGlassPane(), RootPaneContainer.setGlassPane(java.awt.Component)getGraphics
Creates a graphics context for this component. This method will return
null
if this component is currently not displayable.
Overrides:
[getGraphics](../../java/awt/Component.html#getGraphics%28%29)
in class[Component](../../java/awt/Component.html "class in java.awt")
Returns:
a graphics context for this component, ornull
if it has none
Since:
1.6
See Also:
Component.paint(java.awt.Graphics)repaint
public void repaint(long time, int x, int y, int width, int height)
Repaints the specified rectangle of this component withintime
milliseconds. Refer toRepaintManager
for details on how the repaint is handled.
Overrides:
[repaint](../../java/awt/Component.html#repaint%28long,int,int,int,int%29)
in class[Component](../../java/awt/Component.html "class in java.awt")
Parameters:
time
- maximum time in milliseconds before update
x
- the x coordinate
y
- the y coordinate
width
- the width
height
- the height
Since:
1.6
See Also:
RepaintManagerparamString
protected String paramString()
Returns a string representation of thisJWindow
. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull
.
Overrides:
[paramString](../../java/awt/Container.html#paramString%28%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Returns:
a string representation of thisJWindow
getAccessibleContext
Gets the AccessibleContext associated with this JWindow. For JWindows, the AccessibleContext takes the form of an AccessibleJWindow. A new AccessibleJWindow instance is created if necessary.
Specified by:
[getAccessibleContext](../accessibility/Accessible.html#getAccessibleContext%28%29)
in interface[Accessible](../accessibility/Accessible.html "interface in javax.accessibility")
Overrides:
[getAccessibleContext](../../java/awt/Window.html#getAccessibleContext%28%29)
in class[Window](../../java/awt/Window.html "class in java.awt")
Returns:
an AccessibleJWindow that serves as the AccessibleContext of this JWindow