This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree - highlight the text when it is being changed

 
Alex Ku
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How do you highlight the text in a tree node when the user clicks the node or press F2 to change its value?
Thanks,
Kawaii
 
Alex Ku
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the file that sets up the JTree, I have

I override the getTreeCellEditorComponent in the DefaultTreeCellEditor class

this only works fine with F2 being pressed, not mouse clicked.
Anyone knows how to highlight the text for mouse clicked?
Thanks
[ January 22, 2002: Message edited by: kawaii desu ]

Nathan Pruett - Edited long CODE line.
[ January 23, 2002: Message edited by: Nathan Pruett ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic