This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Swing pane to pane interaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Swing pane to pane interaction" Watch "Swing pane to pane interaction" New topic

Swing pane to pane interaction

K. Tsang

Joined: Sep 13, 2007
Posts: 2941

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?


Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
You probably forgot to call a fire...Changed() when changing the table model of the presented table. Probably fireTableChanged() or fireTableDataChanged() should be called.

SCJP 1.4 100%
SCJD 99.5%
It is sorta covered in the JavaRanch Style Guide.
subject: Swing pane to pane interaction
It's not a secret anymore!