JInternalFrame objects and add them to the
JDesktopPane. JDesktopPane extends
JLayeredPane to manage the potentially overlapping internal
frames. It also maintains a reference to an instance of
DesktopManager that is set by the UI
class for the current look and feel (L&F). Note that JDesktopPane
does not support borders.
This class is normally used as the parent of JInternalFrames
to provide a pluggable DesktopManager object to the
JInternalFrames. The installUI of the
L&F specific implementation is responsible for setting the
desktopManager variable appropriately.
When the parent of a JInternalFrame is a JDesktopPane,
it should delegate most of its behavior to the desktopManager
(closing, resizing, etc).
For further documentation and examples see How to Use Internal Frames, a section in The Java Tutorial.
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 java..
JInternalFrame, JInternalFrame.JDesktopIcon , DesktopManager
| Modifier and Type | Class and Description |
|---|---|
| protected class | JDesktopPane.
This class implements accessibility support for the
|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean | |
| pack-priv transient DesktopManager | |
| private int | |
| private boolean | |
| private transient List | |
| public static final int | LIVE_DRAG_MODE
Indicates that the entire contents of the item being dragged should appear inside the desktop pane. |
| public static final int | OUTLINE_DRAG_MODE
Indicates that an outline only of the item being dragged should appear inside the desktop pane. |
| private transient JInternalFrame | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addImpl(Component comp, Object constraints, int index)
Overrides javax. Adds the specified component to this container at the specified index. |
| private void | |
| public AccessibleContext | Returns: anAccessibleJDesktopPane that serves as the
AccessibleContext of this JDesktopPaneOverrides javax. Implements javax. Gets the |
| public JInternalFrame[] | Returns: an array ofJInternalFrame objectsReturns all |
| private static Collection | |
| public JInternalFrame[] | Returns: an array ofJInternalFrame objectsan int specifying the desktop layer layer)Returns all |
| public DesktopManager | Returns: theDesktopManger that handles desktop-specific
UI actionsReturns the |
| public int | Returns: eitherLive_DRAG_MODE or
OUTLINE_DRAG_MODEGets the current "dragging style" used by the desktop pane. |
| private List | |
| private JInternalFrame | |
| pack-priv JInternalFrame | |
| public JInternalFrame | Returns: the currently activeJInternalFrame or
nullReturns the currently active |
| private JInternalFrame | |
| public DesktopPaneUI | Returns: theDesktopPaneUI object that
renders this componentOverrides javax. Returns the L&F object that renders this component. |
| public String | Returns: the string "DesktopPaneUI"Overrides javax. Returns the name of the L&F class that renders this component. |
| protected String | Returns: a string representation of thisJDesktopPaneOverrides javax. Returns a string representation of this |
| public void | remove(Component comp)
Overrides java. Removes the specified component from this container. |
| public void | remove(int index)
Overrides javax. Remove the indexed component from this pane. |
| public void | removeAll()
Overrides javax. Removes all the components from this container. |
| public JInternalFrame | Returns: the JInternalFrame that was selected ornull
if nothing was selecteda boolean indicating which direction to select in;
forward)true for forward, false for
backwardSelects the next |
| pack-priv void | |
| public void | setComponentZOrder(Component comp, int index)
Overrides java. Moves the specified component to the specified z-order index in the container. |
| public void | setDesktopManager(DesktopManager
the d)DesktopManager to useSets the |
| public void | setDragMode(int
the style of drag to use for items in the Desktop dragMode)Sets the "dragging style" used by the desktop pane. |
| public void | setSelectedFrame(JInternalFrame
the internal frame that's currently selected f)Sets the currently active |
| public void | |
| pack-priv void | |
| private void | |
| public void | updateUI()
Overrides javax. Notification from the |
| private void | |
| private void | writeObject(ObjectOutputStream s)
Hides javax. See readObject() and writeObject() in JComponent for more information about serialization in Swing. |
| componentOrderChanged | back to summary |
|---|---|
| private boolean componentOrderChanged | |
| componentOrderCheckingEnabled | back to summary |
|---|---|
| private boolean componentOrderCheckingEnabled | |
| desktopManager | back to summary |
|---|---|
| pack-priv transient DesktopManager desktopManager | |
| dragMode | back to summary |
|---|---|
| private int dragMode | |
| dragModeSet | back to summary |
|---|---|
| private boolean dragModeSet | |
| framesCache | back to summary |
|---|---|
| private transient List<JInternalFrame> framesCache | |
| LIVE_DRAG_MODE | back to summary |
|---|---|
| public static final int LIVE_DRAG_MODE Indicates that the entire contents of the item being dragged should appear inside the desktop pane.
| |
| OUTLINE_DRAG_MODE | back to summary |
|---|---|
| public static final int OUTLINE_DRAG_MODE Indicates that an outline only of the item being dragged should appear inside the desktop pane.
| |
| selectedFrame | back to summary |
|---|---|
| private transient JInternalFrame selectedFrame | |
| uiClassID | back to summary |
|---|---|
| private static final String uiClassID Hides javax.
| |
| JDesktopPane | back to summary |
|---|---|
| public JDesktopPane() Creates a new | |
| addImpl | back to summary |
|---|---|
| protected void addImpl(Component comp, Object constraints, int index) Overrides javax. Doc from java. Adds the specified component to this container at the specified
index. This method also notifies the layout manager to add
the component to this container's layout using the specified
constraints object via the
The constraints are
defined by the particular layout manager being used. For
example, the
The
If the current layout manager implements If the component is not an ancestor of this container and has a non-null parent, it is removed from its current parent before it is added to this container. This is the method to override if a program needs to track every add request to a container as all other add methods defer to this one. An overriding method should usually include a call to the superclass's version of the method:
This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to display the added component.
| |
| checkComponentAttributes | back to summary |
|---|---|
| private void checkComponentAttributes(Component comp) | |
| getAccessibleContext | back to summary |
|---|---|
| public AccessibleContext getAccessibleContext() Overrides javax. Implements javax. Gets the
| |
| getAllFrames | back to summary |
|---|---|
| public JInternalFrame[] getAllFrames() Returns all
| |
| getAllFrames | back to summary |
|---|---|
| private static Collection | |
| getAllFramesInLayer | back to summary |
|---|---|
| public JInternalFrame[] getAllFramesInLayer(int layer) Returns all
| |
| getDesktopManager | back to summary |
|---|---|
| public DesktopManager getDesktopManager() Returns the
| |
| getDragMode | back to summary |
|---|---|
| public int getDragMode() Gets the current "dragging style" used by the desktop pane.
| |
| getFrames | back to summary |
|---|---|
| private List | |
| getNextFrame | back to summary |
|---|---|
| private JInternalFrame getNextFrame(JInternalFrame f, boolean forward) | |
| getNextFrame | back to summary |
|---|---|
| pack-priv JInternalFrame getNextFrame(JInternalFrame f) | |
| getSelectedFrame | back to summary |
|---|---|
| public JInternalFrame getSelectedFrame() Returns the currently active
| |
| getTopInternalFrame | back to summary |
|---|---|
| private JInternalFrame getTopInternalFrame() | |
| getUI | back to summary |
|---|---|
| public DesktopPaneUI getUI() Overrides javax. Returns the L&F object that renders this component.
| |
| getUIClassID | back to summary |
|---|---|
| public String getUIClassID() Overrides javax. Returns the name of the L&F class that renders this component.
| |
| paramString | back to summary |
|---|---|
| protected String paramString() Overrides javax. Returns a string representation of this
| |
| remove | back to summary |
|---|---|
| public void remove(Component comp) Overrides java. Doc from java. Removes the specified component from this container.
This method also notifies the layout manager to remove the
component from this container's layout via the
This method changes layout-related information, and therefore, invalidates the component hierarchy. If the container has already been displayed, the hierarchy must be validated thereafter in order to reflect the changes.
| |
| remove | back to summary |
|---|---|
| public void remove(int index) Overrides javax. Doc from javax. Remove the indexed component from this pane. This is the absolute index, ignoring layers.
| |
| removeAll | back to summary |
|---|---|
| public void removeAll() Overrides javax. Doc from javax. Removes all the components from this container.
| |
| selectFrame | back to summary |
|---|---|
| public JInternalFrame selectFrame(boolean forward) Selects the next
| |
| setComponentOrderCheckingEnabled | back to summary |
|---|---|
| pack-priv void setComponentOrderCheckingEnabled(boolean enable) | |
| setComponentZOrder | back to summary |
|---|---|
| public void setComponentZOrder(Component comp, int index) Overrides java. Doc from java. Moves the specified component to the specified z-order index in the container. The z-order determines the order that components are painted; the component with the highest z-order paints first and the component with the lowest z-order paints last. Where components overlap, the component with the lower z-order paints over the component with the higher z-order.
If the component is a child of some other container, it is
removed from that container before being added to this container.
The important difference between this method and
This property is guaranteed to apply only to lightweight
non- This method changes layout-related information, and therefore, invalidates the component hierarchy. Note Not all platforms support changing the z-order of
heavyweight components from one container into another without
the call to
| |
| setDesktopManager | back to summary |
|---|---|
| public void setDesktopManager(DesktopManager d) Sets the
| |
| setDragMode | back to summary |
|---|---|
| public void setDragMode(int dragMode) Sets the "dragging style" used by the desktop pane. You may want to change to one mode or another for performance or aesthetic reasons.
| |
| setSelectedFrame | back to summary |
|---|---|
| public void setSelectedFrame(JInternalFrame f) Sets the currently active
| |
| setUI | back to summary |
|---|---|
| public void setUI(DesktopPaneUI ui) Sets the L&F object that renders this component.
| |
| setUIProperty | back to summary |
|---|---|
| pack-priv void setUIProperty(String propertyName, Object value) Overrides javax. | |
| updateFramesCache | back to summary |
|---|---|
| private void updateFramesCache() | |
| updateUI | back to summary |
|---|---|
| public void updateUI() Overrides javax. Notification from the
| |
| verifyFramesCache | back to summary |
|---|---|
| private void verifyFramesCache() | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream s) throws IOException Hides javax. See readObject() and writeObject() in JComponent for more information about serialization in Swing.
| |
JDesktopPane class. It provides an implementation of the
Java Accessibility API appropriate to desktop pane user-interface
elements.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 java..
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public AccessibleRole | Returns: an instance of AccessibleRole describing the role of the objectOverrides javax. Get the role of this object. |
| AccessibleJDesktopPane | back to summary |
|---|---|
| protected AccessibleJDesktopPane() Constructs an | |
| getAccessibleRole | back to summary |
|---|---|
| public AccessibleRole getAccessibleRole() Overrides javax. Get the role of this object.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final JInternalFrame | |
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(JDesktopPane.
Implements java. Compares this object with the specified object for order. |
| component | back to summary |
|---|---|
| private final JInternalFrame component | |
| layer | back to summary |
|---|---|
| private final int layer | |
| zOrder | back to summary |
|---|---|
| private final int zOrder | |
| ComponentPosition | back to summary |
|---|---|
| pack-priv ComponentPosition(JInternalFrame component, int layer, int zOrder) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(JDesktopPane. Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |