Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing pane to pane interaction

 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, I have a questions about given I have 2 panes (left-right), when I click some action on the left pane I want the right pane to change accordingly. How do I do that?

I have a JPanel on the left and a JScrollPane/JTable on the right. The JTable has different table models for different data. Currently the event I trigger on the left works if I output to command prompt or if I open another JFrame. I want to achieve when left pane event triggers the right pane change accordingly whether its JScrollPane/JTable or JPanel. My main client class extends JFrame.

Also would it be easier if I used JSplitPane? If I use JSplitPane, is there a method to disable the movement of the location bar?

Thanks.
 
Alecsandru Cocarla
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably forgot to call a fire...Changed() when changing the table model of the presented table. Probably fireTableChanged() or fireTableDataChanged() should be called.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic