Gui - Best way to navigate between windows?

I try to build a gui (Swing) for a simple java application. The application should have a start window like a menu. From there I would like to navigate to several other windows.

My question is what is the best-practice to achieve such a navigation? Should I build several JFrames and switch the visibility of them on/off when navigating OR should I better have one JFrame and add/remove JPanels in this single frame to navigate between the windows?

Thanks.

Answers


If each of your windows correspond to different task (possibly nested), you could present your application as a SDI, with on the left a task panel like:

Each of the task would display one JFrame with the associated window.

Other solution: a table of content like this picture on the left side

(note: it actually also displays a task panel in this example on the bottom right)


I recommend

  • Do not do a MDI application with sub-frames like those found in the old Windows days. They suck as they make the matter confusing.
  • Do design a tabbed interface. The welcome page/menu will be displayed on a first tab that is always created on the start.

All cool kids do that nowadays:

  • Visual Studio
  • Eclipse
  • Firefox

Multiple JFrames sounds like a better idea to me. Much more OO.


You must find a balance between these goals:

  • Not too many things in one "window"
  • The user must quickly be able to find the correct window to do the next step of work
  • All relevant information must be visible at any time

Eclipse solves this by creating many small editors where each editor shows some specific information and allows to modify it. Editors are then arranged within one OS window in tabs and "views". A view is always completely visible and they can be arranged. Think of a view as a way to cut an existing editor in half (horizontal or vertical) and then being able to replace one of the halves with another editor. Between each half, you have a splitter so you can adjust the sizes.

Arrangements of views are then saved in "perspectives".

This allows every user to create a perspective which contains all the necessary editors at the same time, arrange them as they need it and work effectively.


Need Your Help

Display custom ASP.NET error page without rewriting URL

javascript asp.net

Currently working on error pages for my website in ASP.NET. I'm using a web configuration file to redirect the user to an error page if the server was unable to find the requested page. Below is the

How to change the images on button click

javascript jquery html css3

I want to change the image by pressing the button.I have two button, one is next and other is previous.When the next button press new image must be shown and previous button press last image should...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.