Java Reference
In-Depth Information
Table 8-14. JDesktopPane Properties
Property Name
Data Type
Access
accessibleContext
AccessibleContext
Read-only
allFrames
JInternalFrame[ ]
Read-only
desktopManager
DesktopManager
Read-write
dragMode
int
Read-write bound
opaque
boolean
Read-only
selectedFrame
JInternalFrame
Read-write
UI
DesktopPaneUI
Read-write
UIClassID
String
Read-only
Note There is also a special client property ( JDesktopPane.dragMode ) for configuring the drawing
mode when dragging an internal frame around. The client property has been replaced by the speedier
versions available with the standard property.
Customizing a JDesktopPane Look and Feel
Back in Figure 8-5 you can see JInternalFrame objects within a JDesktopPane . The basic appear-
ance of JDesktopPane is the same in each look and feel. As Table 8-15 shows, there aren't many
UIResource -related properties for a JDesktopPane to configure.
Table 8-15. JDesktopPane UIResource Elements
Property String
Object Type
desktop
Color
Desktop.ancestorInputMap
InputMap
Desktop.background
Color
Desktop.windowBindings
Object[ ]
DesktopPane.actionMap
ActionMap
DesktopPaneUI
String
Complete Desktop Example
Now that you have the major desktop-related classes under your belt, let's look at a complete
desktop example. The basic process involves creating a group of JInternalFrame objects and
putting them in a single JDesktopPane . Event handling can be done for individual components
on each of the internal frames, if desired, or for individual frames. In this example, simply use
 
Search WWH ::




Custom Search