• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree selection events  RSS feed

 
Dave Robbins
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All

I have an app that is kindof an explorer interface
JTree on the left, for each node you select it displays info about that node on the right
the info displayed is pulled from a database and is editable by the user
so each time the user selects a new node, I need to decide if any info has changed and needs to be written back to the DB
I need to know stuff about the node the user is leaving
I've tried a TreeSelectionListener but it seems to only give me the new node the user has selected which of course I need so I can load it's info, but first I need to save info from the node the user is leaving
surely this is a common task, how does one go about it??

TIA
Dave
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Dave Robbins
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Craig
now I see how it works

Dave
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!