Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TreeSelectionListener  RSS feed

 
Chant Dhames
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to fire an event for TreeSelectionListener without clicking anywhere inside the jtree? I have a button that, when pressed, selects the next entry in the jtree, and would like the TreeSelectionListener to follow suit and highlight the object when the button is pushed.
Thx.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets move this to Swing.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you really need the TreeSelectionListener for selecting the next value? I don't think so. I'd just select the appropriate value when the button gets clicked.
something like:
jTree.getSelectionModel().setSelectionPath(newPath);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!