aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable jumping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable jumping" Watch "JTable jumping" New topic
Author

JTable jumping

Krithika Beri
Ranch Hand

Joined: Sep 11, 2012
Posts: 36
I have a JTree and to that a TreeselectionListener. When ever i click on any node on the tree, its related information is displayed. The tables are editable and the edited values are updated. The problem is that when i click on the table to edit, it is displaying the value of the node clicked on earlier. Displaying is taking place properly, but when i click on editing the problem occurs.


Krithika Beri
Ranch Hand

Joined: Sep 11, 2012
Posts: 36
Can anyone please help me how to proceed.
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 156
DYM ???
Krithika Beri
Ranch Hand

Joined: Sep 11, 2012
Posts: 36
When i click on any node on the tree, the tables are supposed to appear. The tables cannot be a part of the tree.
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 156
for better help sooner post an SSCCE demonstraded your issue, not code snipped (talking about issue about anywhere)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

Have you checked out TreeSelectionListener? It gets notified when the selection in the tree changes. If you set the selection mode to single selection you can then retrieve the single selected node and use that to rebuild your table (usually you give the existing JTable a new model instead of creating a completely new JTable).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable jumping