• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTree - highlight the text when it is being changed

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic