This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Swing pane to pane interaction" Watch "Swing pane to pane interaction" New topic
Author

Swing pane to pane interaction

K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2380
    
    7

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.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
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%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing pane to pane interaction