jGuru
Register Email     Password Forgot your
password?
HOME FAQS FORUMS DOWNLOADS ARTICLES PEERSCOPE LEARN

  Search   jGuru Search Help

Question How can I create a multiple document interface(MDI) application in Java?
Derived from A question posed by pulikkan jose
Topics Java:API:Swing
Author Sandip Chitale PREMIUM
Created May 1, 2000 Modified May 2, 2000


Answer

Well the Multiple Document Interface is different things to different people. If you are talking about visual aspects of MDI i.e. just the set of child windows(MDICHildWindows) that stay inside the main application window. That can be achieved simply by using the following classes from Swing -

javax.swing.JDesktopPane
javax.swing.JInternalFrame
javax.swing.JInternalFrame.JDesktopIcon

Mind you though - this still does not behave exactly like M*Soft's implementation of MDI. The differences are as follows -

  1. The maximized JInternalFrames still have the TitleBar and other buttons like minimize/restore/close do not merge into main application's menubar.
  2. Multiple layers are supported in the JDesktopPane (being a subclass of JLayeredPane).
  3. Automatic switching of the MenuBar based on which child window has the focus is not supplied. You have to manage it.

If you are talking about the full blown notion of MDI i.e.

Application
DocumentFactory or ModelFactory
Document or Model
View
Frame and MDIChildWindow

You will have to do it yourselves.

Is this item helpful?  yes  no     Previous votes   Yes: 1  No: 0



Comments and alternative answers

Comment on this FAQ entry

If you have JBuilder, try the following sample, it...
Tarek Filali, Sep 25, 2000
If you have JBuilder, try the following sample, it will be helpful for you

JBuilder2\samples\java\swing-1.0.1\Metalworks

[FAQ Manager Note] The metalworks demo should be in all Swing distributions, as well as in the Java2 SDK distribution



Is this item helpful?  yes  no     Previous votes   Yes: 1  No: 0



Reply to this answer/comment  Help  


Ask A Question



 
Related Links

Swing FAQ

Swing Forum

Sun's Swing Home Page

The Swing Connection

Swing in the Java Tutorial

Swing Short Course, part I

Swing Short Course, part II

Wish List
Features
About jGuru
Contact Us

 



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers