In this section, you will learn how to create a desktop pane container in Java. The desktop pane container is a container, which has the internal frame. This internal frame has the same feature as like a frame. The desktop pane is like a MDI (Multiple Document Interface) frame and all internal frames are like the child frame for the main frame. All internal frames open under the desktop pane. Following figure shows the JDesktopPane component of Java Swing:
This program shows the internal frame inside the MDI frame. The internal frame has two command buttons: Ok and Cancel. This frame has the minimize, maximize and close buttons that provides the minimize (iconify), maximize and the close operations. Buttons on the internal frame have the tool tip text. Following methods and APIs have been used in the given program for getting the desktop pane container:
JInternalFrame(String iframe_title, Boolean resizable, Boolean closable, Boolean maximizable, Boolean minimizable ):
This is the constructor of JInternalFrame class. It extends from the JComponent. This constructor has been used to create a new internal frame. This constructor takes some argument as follow:
This is the class which creates a desktop pane like MDI (Multiple Document Interface).
Here is the code of program:
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: April 14, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles