javax.swing
Class JDesktopPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by javax.swing.JDesktopPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

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.

See Also:
Serialized Form

Nested Class Summary
protected  class JDesktopPane.AccessibleJDesktopPane
          Provides the accessibility features for the JDesktopPane component.
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int LIVE_DRAG_MODE
          This specifies that when dragged, a JInternalFrame should be completely visible.
static int OUTLINE_DRAG_MODE
          This specifies that when dragged, a JInternalFrame should only be visible as an outline.
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JDesktopPane()
          Creates a new JDesktopPane object.
 
Method Summary
 AccessibleContext getAccessibleContext()
          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.
 DesktopManager getDesktopManager()
          This method returns the DesktopManager used with the JDesktopPane.
 int getDragMode()
          This method returns the drag mode used with the JDesktopPane.
 JInternalFrame getSelectedFrame()
          This method returns the currently selected frame in the JDesktopPane.
 DesktopPaneUI getUI()
          This method returns the UI used with the JDesktopPane.
 String getUIClassID()
          This method returns a String identifier that allows the UIManager to know which class will act as JDesktopPane's UI.
 boolean isOpaque()
          This method always returns true to indicate that it is not transparent.
protected  String paramString()
          Returns an implementation-dependent string describing the attributes of this JDesktopPane.
 void setDesktopManager(DesktopManager manager)
          This method sets the DesktopManager to use with the JDesktopPane.
 void setDragMode(int mode)
          This method sets the drag mode to use with the JDesktopPane.
 void setSelectedFrame(JInternalFrame frame)
          This method sets the selected frame in the JDesktopPane.
 void setUI(DesktopPaneUI ui)
          This method sets the UI used with the JDesktopPane.
 void updateUI()
          This method restores the UI used with the JDesktopPane to the default.
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, removeAll, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LIVE_DRAG_MODE

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

See Also:
Constant Field Values

OUTLINE_DRAG_MODE

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

See Also:
Constant Field Values
Constructor Detail

JDesktopPane

public JDesktopPane()
Creates a new JDesktopPane object.

Method Detail

getUI

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

Returns:
The UI used with 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.

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.

getDragMode

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

Returns:
The drag mode used with the JDesktopPane.

getDesktopManager

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

Returns:
The DesktopManager to use with the JDesktopPane.

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.

updateUI

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

Overrides:
updateUI in class JComponent

getUIClassID

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

Overrides:
getUIClassID in class JComponent
Returns:
A String identifier for the UI class to use.
See Also:
JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

getAllFrames

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

Returns:
All JInternalFrames that are in the JDesktopPane.

getSelectedFrame

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

Returns:
The currently selected frame in the JDesktopPane.

setSelectedFrame

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

Parameters:
frame - The selected frame 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.

isOpaque

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

Overrides:
isOpaque in class JComponent
Returns:
true.
See Also:
Component.isLightweight()

paramString

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

Overrides:
paramString in class JComponent
Returns:
A string describing the attributes of this JDesktopPane (never null).

getAccessibleContext

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

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JLayeredPane
Returns:
The accessible context (an instance of JDesktopPane.AccessibleJDesktopPane).