• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing App Best Practices Question.  RSS feed

 
Will Rogers
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got a JFrame that contains a JList on the left 1/4th and a JTable on the remaining 3/4ths of the application window (similar to how your browser might be set up). The JTable contains a list of people. When the user double-clicks on one of the rows in the JTable, I want the JTable to disappear and a bio page to appear containing more info about the selected person.
My question is: what's the most efficient thing to do with all the JTable objects (the JTable, the DataModel, the CellRenderer, etc.) while the bio is being displayed? I plan on including a "back" button on the bio page that will re-display the original JTable.
Should I create a new JPanel that includes all the bio info, or should I use the original JTable's content pane?
Thanks in advance for any advice,
Will.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One possibility is to use CardLayout and just flip between the 2. Another would be a JDialog with the information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!