javax.swing

Class JDesktopPane

public class JDesktopPane extends JLayeredPane implements Accessible

JDesktopPane is a container (usually for JInternalFrames) that simulates a desktop. Typically, the user will create JInternalFrames and place them in a JDesktopPane. The user can then interact with JInternalFrames like they usually would with JFrames. The actions (minimize, maximize, close, etc) are done by using a DesktopManager that is associated with the JDesktopPane.
Nested Class Summary
protected classJDesktopPane.AccessibleJDesktopPane
Provides the accessibility features for the JDesktopPane component.
Field Summary
static intLIVE_DRAG_MODE
This specifies that when dragged, a JInternalFrame should be completely visible.
static intOUTLINE_DRAG_MODE
This specifies that when dragged, a JInternalFrame should only be visible as an outline.
Constructor Summary
JDesktopPane()
Creates a new JDesktopPane object.
Method Summary
AccessibleContextgetAccessibleContext()
Returns the object that provides accessibility features for this JDesktopPane component.
JInternalFrame[]getAllFrames()
This method returns all JInternalFrames that are in the JDesktopPane.
JInternalFrame[]getAllFramesInLayer(int layer)
This method returns all the JInternalFrames in the given layer.
DesktopManagergetDesktopManager()
This method returns the DesktopManager used with the JDesktopPane.
intgetDragMode()
This method returns the drag mode used with the JDesktopPane.
JInternalFramegetSelectedFrame()
This method returns the currently selected frame in the JDesktopPane.
DesktopPaneUIgetUI()
This method returns the UI used with the JDesktopPane.
StringgetUIClassID()
This method returns a String identifier that allows the UIManager to know which class will act as JDesktopPane's UI.
booleanisOpaque()
This method always returns true to indicate that it is not transparent.
protected StringparamString()
Returns an implementation-dependent string describing the attributes of this JDesktopPane.
voidsetDesktopManager(DesktopManager manager)
This method sets the DesktopManager to use with the JDesktopPane.
voidsetDragMode(int mode)
This method sets the drag mode to use with the JDesktopPane.
voidsetSelectedFrame(JInternalFrame frame)
This method sets the selected frame in the JDesktopPane.
voidsetUI(DesktopPaneUI ui)
This method sets the UI used with the JDesktopPane.
voidupdateUI()
This method restores the UI used with the JDesktopPane to the default.

Field Detail

LIVE_DRAG_MODE

public static final int LIVE_DRAG_MODE
This specifies that when dragged, a JInternalFrame should be completely visible.

UNKNOWN: final since 1.5.0.

OUTLINE_DRAG_MODE

public static final int OUTLINE_DRAG_MODE
This specifies that when dragged, a JInternalFrame should only be visible as an outline.

UNKNOWN: final since 1.5.0.

Constructor Detail

JDesktopPane

public JDesktopPane()
Creates a new JDesktopPane object.

Method Detail

getAccessibleContext

public AccessibleContext getAccessibleContext()
Returns the object that provides accessibility features for this JDesktopPane component.

Returns: The accessible context (an instance of {@link AccessibleJDesktopPane}).

getAllFrames

public JInternalFrame[] getAllFrames()
This method returns all JInternalFrames that are in the JDesktopPane.

Returns: All JInternalFrames that are in the JDesktopPane.

getAllFramesInLayer

public JInternalFrame[] getAllFramesInLayer(int layer)
This method returns all the JInternalFrames in the given layer.

Parameters: layer The layer to grab frames in.

Returns: All JInternalFrames in the given layer.

getDesktopManager

public DesktopManager getDesktopManager()
This method returns the DesktopManager used with the JDesktopPane.

Returns: The DesktopManager to use with the JDesktopPane.

getDragMode

public int getDragMode()
This method returns the drag mode used with the JDesktopPane.

Returns: The drag mode used with the JDesktopPane.

getSelectedFrame

public JInternalFrame getSelectedFrame()
This method returns the currently selected frame in the JDesktopPane.

Returns: The currently selected frame in the JDesktopPane.

getUI

public DesktopPaneUI getUI()
This method returns the UI used with the JDesktopPane.

Returns: The UI used with the JDesktopPane.

getUIClassID

public String getUIClassID()
This method returns a String identifier that allows the UIManager to know which class will act as JDesktopPane's UI.

Returns: A String identifier for the UI class to use.

isOpaque

public boolean isOpaque()
This method always returns true to indicate that it is not transparent.

Returns: true.

paramString

protected String paramString()
Returns an implementation-dependent string describing the attributes of this JDesktopPane.

Returns: A string describing the attributes of this JDesktopPane (never null).

setDesktopManager

public void setDesktopManager(DesktopManager manager)
This method sets the DesktopManager to use with the JDesktopPane.

Parameters: manager The DesktopManager to use with the JDesktopPane.

setDragMode

public void setDragMode(int mode)
This method sets the drag mode to use with the JDesktopPane.

Parameters: mode The drag mode to use.

Throws: IllegalArgumentException If the drag mode given is not LIVE_DRAG_MODE or OUTLINE_DRAG_MODE.

setSelectedFrame

public void setSelectedFrame(JInternalFrame frame)
This method sets the selected frame in the JDesktopPane.

Parameters: frame The selected frame in the JDesktopPane.

setUI

public void setUI(DesktopPaneUI ui)
This method sets the UI used with the JDesktopPane.

Parameters: ui The UI to use with the JDesktopPane.

updateUI

public void updateUI()
This method restores the UI used with the JDesktopPane to the default.