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 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, start with a JFrame component and then add a JDesktopPane component to it. You can use the MDI Application option in the Sample Forms category of the Template Chooser to create a new MDI form with predefined common menu items, or you can build an MDI application by starting with a JFrame and adding a JDesktopPane component to it.

To add JInternalFrame components to the JDesktopPane, select them from the Swing (Other) tab of the component palette and click in the JDesktopPane. This adds internal frames with fixed structures. Alternatively, you can create separate forms of type JInternalFrame, and then construct and add these to the desktop pane in code.

You can add other components directly to the JDesktopPane, 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.

See also
Creating a New Form

Working With Components

Legal Notices