How can I create an application which contains multiple frames?

John Zukowski

There is nothing special about having an application have multiple frames. Just create multiple Frame/JFrame objects. Each will share the same event thread so they cannot run completely independent of each other.

One thing worth mentioning is that often one doesn't create multiple frames, but instead uses one main Frame and subsequent frames are actually Dialog boxes. That way, if you were to iconify the Frame, the dialog boxes would be iconified automatically with them.

If you are looking more for an MDI-like architecture, consider using Swing's JDesktopPane with multiple JInternalFrame objects.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact