Creating a Multiple Document Interface (MDI) Application
See Also
The multiple document interface (MDI) model is similar to a traditional computer
windowing system in that it includes a desktop above which additional windows
float. In a JFC/Swing MDI application, the individual internal windows
are all contained within a single enclosing window (i.e. desktop) which
users can position, resize, minimize, and close.
To create an MDI application:
- Choose File > New to display the New wizard.
- In the New File wizard's Project combo box, select the project for which
you want to create the form.
- Expand the Java GUI Forms node and select
one of the following templates:
- JFrame Form
builds an MDI application from scratch. Note that you
must also add a JDesktopPane component if you choose this template.
- MDI Application (in Sample Forms) creates a
new MDI form with a JDesktopPane and predefined common menu
items.
- Click Next.
- On the wizard's Name and Location page, enter the form's name in the Class
Name combo box, then specify the Location and Package. Click Finish. The IDE
displays the new file in the Created File field.
- (Optional) If you chose the JFrame Form template, select the JDesktopPane node
in the Palette window's Swing category and click anywhere in the form.
- (Optional) Add JInternalFrame components
to the JDesktopPane container
by selecting JInternalFrame components
from the Swing category in the Palette window and click in the JDesktopPane container.
Alternately, you can copy and paste JInternalFrame components
to the JDesktopPane container in the Files or Project window.
The IDE updates the form's layout and displays the new internal frames
in the GUI Builder.
Notes:
- 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.
- You can also create separate JInternalFrame forms and add
these to the JDesktopPane container
programmatically at runtime.
- See Also
- Creating a New Form
- Adding a Component to a Form
- Designing Java GUIs with the GUI Builder
Legal Notices