Creating a Multiple Document Interface (MDI) Application
The multiple document interface (MDI) model is like a traditional computer windowing
system, in that it has windows within windows. In a windowing system, you have a
desktop with windows on it. With a Swing MDI application, you have a backing window
(desktop pane) with internal frames on it. The user can position, resize, close,
and minimize the internal frames like windows on a traditional desktop.
To create an MDI application:
-
Choose File
New to display the New
wizard. Then expand the GUI Forms node and select one of these templates in the
Template Chooser:
-
The MDI Application option in the Sample Forms category creates a new
MDI form with predefined common menu items.
-
The JFrame template (with the addition of a JDesktopPane
component) builds an MDI application from scratch.
-
Add JInternalFrame components to the JDesktopPane
container using one of these methods:
-
Select JInternalFrame components from the Swing (Other) tab of the
component palette and click in the JDesktopPane container. This adds
internal frames with fixed structures.
-
Create separate forms of type JInternalFrame and then construct and add
these to the JDeskTopPane container in code. You can also copy a
JInternalFrame form (after it is compiled) to the
JDeskTopPane container in the Explorer using Copy and Paste functions
of the contextual menu.
 |
You can add other components directly to the JDesktopPane container,
such as a JTable or JSlider component. However, these
have standard properties and users can't manipulate them as they might manipulate
components in a JInternalFrame container.
|
Legal Notices