Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tabbed UI or Internal Frames  RSS feed

 
Rob Levo
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing an app that will be used as the UI for different functions related to the same overall project.
I will have an OO design that will either use internal frames (each internal frame used for a function), or a tabbed window (each tab used for a different function).
I would appreciate any thoughts on which of these would be the better choice, or perhaps something else I have not thought of.
It is going to be a large UI and I want to start out with a good design.
Thanks,
Rob
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as you have a JPanel for each "function", it doesn't really matter if you use a JDesktop/JInternalFrame approach, or a series of tabbed panes. When you need to display the appropriate "function", you can add it to either a tab or an internal frame.

Actually, the only design issues would be these:
  • Does the user need access to multiple "functions" at the same time? Then you should use the internal frame approach.
  • Should the user only have access to one function at a time ( for validation or locking related reasons )? Then you should use the tabbed pane approach.

  •  
    Rob Levo
    Ranch Hand
    Posts: 167
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Nathan Pruett:
    As long as you have a JPanel for each "function", it doesn't really matter if you use a JDesktop/JInternalFrame approach, or a series of tabbed panes. When you need to display the appropriate "function", you can add it to either a tab or an internal frame.

    Actually, the only design issues would be these:
  • Does the user need access to multiple "functions" at the same time? Then you should use the internal frame approach.
  • Should the user only have access to one function at a time ( for validation or locking related reasons )? Then you should use the tabbed pane approach.


  • Thanks!
    Would I be able to dynamaically change the main menu when switching internal frames or by switching tabs, this will be a requirement.
    Each "function" will have its own menus, menu bar and fucntionality, and the plan is for all this to be done dynamcially when switching "functions".
    When you say that each "function has to have its own JPanel, do you mean one JPanel for each internal frame. Or if I used the tabbed apprpoach, one JPanel for each tabbed window?
    Thanks again,
    Rob
     
    Nathan Pruett
    Bartender
    Posts: 4121
    IntelliJ IDE Java Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes, I meant you would have a panel for each function, and each panel can go on either a tab or in an internal frame.

    And yes... you can dynamically change the menubar when switching between functions... You can either listen for the tabs being selected or the JInternalFrames being on top. I would subclass JPanel with a method that returned that functions menu.

    Though, I don't know if switching the entire menu bar for each function is a good idea... does the app have any common functionality that will behave the same across all functions (i.e. Exit, application help, save, load...) it may be a better idea to have a general menubar for the whole app, and have one menu that changes based on the selected function.

    Of course, if you go with the internal frame approach, you could have the menubar for the application on top of the application, and have a menubar on each of the internal frames.
     
    Rob Levo
    Ranch Hand
    Posts: 167
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Nate,
    Thanks for the clarification, big help!
    Take care,
    Rob
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!