• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing pane to pane interaction

 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • 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.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!