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:
JFrame
template (with the addition of a JDesktopPane
component) builds an MDI application from scratch.
JInternalFrame
components to the JDesktopPane
container using one of these methods:
JInternalFrame
components from the Swing (Other) tab of the
component palette and click in the JDesktopPane
container. This adds
internal frames with fixed structures.
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.
|
See also | |
---|---|
Creating a New Form
Working With Components |