Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Developing a multiple frame GUI using only SWING.

Status
Not open for further replies.

JProg

Programmer
Apr 4, 2002
88
JP
Hi Everyone,

I am currently developing a GUI that is to have multiple screens. Ideally the GUI will have a "master" or default screen (Frame or Container) that will automatically be displayed when the program is executed.

From this "master" screen I will have several Buttons arranged which when pushed will clear the "master" screen and create a new screen relevant to the particular button push. On each of the "secondary" screens which result from button pushes on the "master" screen there will be one button. This button will be a back button which when pushed will result in the "master" screen being displayed again.

If anybody has any idea of how I can go about this suggestions will be greatly appreciated. I am mostly interested in using SWING however AWT suggestions will also be appreciated.

Regards

D

 
My suggestion is to have a main content component that gets replaced on the button press. Since Swing is built heavily upon the Composite Pattern this is actually very easy to do. The general layout of the window will remain the same (if you want it to) from request to request, only the content component will need to change. The only other thing you will need to do is remember where the back button will take you. This can be done easily using the GoF Command pattern.
 
Hi JProg,

I suggest working with a MDI-form (Multiple Document Interface). I think I've got a little example at home. So if you send me your email-adres, and if I find this example, I will send it to you.
If you're going to work with a MDI-form, it doesn't matter if you want to use SWING or AWT, they both work.

Greetz
 
Hi JProg,

me again. I forgot to leave you my email-adress, so here it is: joris_ercken@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top