All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JWindow
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----com.sun.java.swing.JWindow
- 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 it's only child.
The contentPane() should be the parent of any children of the JWindow.
From the older java.awt.Window object you would normally do something like this:
window.add(child);
However, using JWindow you would code: window.getContentPane().add(child);
The same is true of setting LayoutManagers, removing components,
listing children, etc. All these methods should normally be sent to
the contentPane() instead of the JWindow itself. 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 a BorderLayout
manager set on it.
Please see the JRootPane documentation for a complete description of
the contentPane(), glassPane(), and layeredPane() components.
For the keyboard keys used by this component in the standard Look and
Feel (L&F) renditions, see the
JWindow key assignments.
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 Swing1.0 applications. It will
not be possible to load serialized Swing1.0 objects with future releases
of Swing. The JDK1.2 release of Swing will be the compatibility
baseline for the serialized form of Swing objects.
- See Also:
- JRootPane
-
accessibleContext
- The accessible context property
-
rootPane
- The JRootPane instance that manages the
contentPane
and optional menuBar
for this frame, as well as the
glassPane
.
-
rootPaneCheckingEnabled
- If true then calls to
add
and setLayout
cause an exception to be thrown.
-
JWindow()
- Creates a window with no specified owner.
-
JWindow(Frame)
- Creates a window with the specified owner frame.
-
addImpl(Component, Object, int)
- By default, children may not be added directly to a this component,
they must be added to its contentPane instead.
-
createRootPane()
- Called by the constructor methods to create the default rootPane.
-
getAccessibleContext()
- Get the AccessibleContext associated with this JWindow
-
getContentPane()
- Returns the contentPane object for this window.
-
getGlassPane()
- Returns the glassPane object for this window.
-
getLayeredPane()
- Returns the layeredPane object for this window.
-
getRootPane()
- Returns the rootPane object for this window.
-
isRootPaneCheckingEnabled()
- Returns whether calls to
add
and
setLayout
cause an exception to be thrown.
-
setContentPane(Container)
- Sets the contentPane property.
-
setGlassPane(Component)
- Sets the glassPane property.
-
setLayeredPane(JLayeredPane)
- Sets the layeredPane property.
-
setLayout(LayoutManager)
- By default the layout of this component may not be set,
the layout of its contentPane should be set instead.
-
setRootPane(JRootPane)
- Sets the rootPane property.
-
setRootPaneCheckingEnabled(boolean)
- Determines whether calls to
add
and
setLayout
cause an exception to be thrown.
-
windowInit()
- Called by the constructors to init the JWindow properly.
rootPane
protected JRootPane rootPane
- The JRootPane instance that manages the
contentPane
and optional menuBar
for this frame, as well as the
glassPane
.
- See Also:
- getRootPane, setRootPane
rootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
- If true then calls to
add
and setLayout
cause an exception to be thrown.
- See Also:
- isRootPaneCheckingEnabled, setRootPaneCheckingEnabled
accessibleContext
protected AccessibleContext accessibleContext
- The accessible context property
JWindow
public JWindow()
- Creates a window with no specified owner.
JWindow
public JWindow(Frame owner)
- Creates a window with the specified owner frame.
- Parameters:
- owner - the frame from which the window is displayed
windowInit
protected void windowInit()
- Called by the constructors to init the JWindow properly.
createRootPane
protected JRootPane createRootPane()
- Called by the constructor methods to create the default rootPane.
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
- Returns whether calls to
add
and
setLayout
cause an exception to be thrown.
- Returns:
- true if
add
and setLayout
are checked
- See Also:
- addImpl, setLayout, setRootPaneCheckingEnabled
setRootPaneCheckingEnabled
protected void setRootPaneCheckingEnabled(boolean enabled)
- Determines whether calls to
add
and
setLayout
cause an exception to be thrown.
- Parameters:
- enabled - a boolean value, true if checking is to be
enabled, which cause the exceptions to be thrown
- See Also:
- addImpl, setLayout, isRootPaneCheckingEnabled
addImpl
protected void addImpl(Component comp,
Object constraints,
int index)
- By default, children may not be added directly to a this component,
they must be added to its contentPane instead. For example:
thisComponent.getContentPane().add(child)
An attempt to add to directly to this component will cause an
runtime exception to be thrown. Subclasses can disable this
behavior.
- Throws: Error
- if called with rootPaneChecking true
- Overrides:
- addImpl in class Container
- See Also:
- setRootPaneCheckingEnabled
setLayout
public void setLayout(LayoutManager manager)
- By default the layout of this component may not be set,
the layout of its contentPane should be set instead.
For example:
thisComponent.getContentPane().setLayout(new BorderLayout())
An attempt to set the layout of this component will cause an
runtime exception to be thrown. Subclasses can disable this
behavior.
- Throws: Error
- if called with rootPaneChecking true
- Overrides:
- setLayout in class Container
- See Also:
- setRootPaneCheckingEnabled
getRootPane
public JRootPane getRootPane()
- Returns the rootPane object for this window.
- See Also:
- setRootPane, getRootPane
setRootPane
protected void setRootPane(JRootPane root)
- Sets the rootPane property. This method is called by the constructor.
- Parameters:
- root - the rootPane object for this window
- See Also:
- getRootPane
getContentPane
public Container getContentPane()
- Returns the contentPane object for this window.
- Returns:
- the Container which is the contentPane
- See Also:
- setContentPane, getContentPane
setContentPane
public void setContentPane(Container contentPane)
- Sets the contentPane property. This method is called by the constructor.
- Parameters:
- contentPane - the contentPane object for this window
- Throws: IllegalComponentStateException
- (a runtime
exception) if the content pane parameter is null
- See Also:
- getContentPane, setContentPane
getLayeredPane
public JLayeredPane getLayeredPane()
- Returns the layeredPane object for this window.
- Returns:
- the JLayeredPane object
- See Also:
- setLayeredPane, getLayeredPane
setLayeredPane
public void setLayeredPane(JLayeredPane layeredPane)
- Sets the layeredPane property. This method is called by the constructor.
- Parameters:
- layeredPane - the layeredPane object for this window
- Throws: IllegalComponentStateException
- (a runtime
exception) if the content pane parameter is null
- See Also:
- getLayeredPane, setLayeredPane
getGlassPane
public Component getGlassPane()
- Returns the glassPane object for this window.
- Returns:
- the Component which is the glassPane
- See Also:
- setGlassPane, getGlassPane
setGlassPane
public void setGlassPane(Component glassPane)
- Sets the glassPane property.
This method is called by the constructor.
- Parameters:
- glassPane - the glassPane object for this window
- See Also:
- getGlassPane, setGlassPane
getAccessibleContext
public AccessibleContext getAccessibleContext()
- Get the AccessibleContext associated with this JWindow
- Returns:
- the AccessibleContext of this JWindow
All Packages Class Hierarchy This Package Previous Next Index