• 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

JTreeTable ToolTip problem

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I got the JTreeTable implementation of Sun (as used in their example(http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html)) up and running.

Now I would like to add tooltips to the tree. So I create a custom cell renderer with the tooltip functionality. Now the tooltip only works on the root element of the tree.. the subelements do not show the tooltip..

I override the method like this:



Anyone else encountered this problem, or someone who know's how to fix this?

Thanks!
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

With most complex java components if you want a tool tip you need to overwrite the getToolTipText( MouseEvent e ) method and then register the component with the ToolTipManager


Example;




Hope that helps,
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!

This is the code I subclassed the renderer (JTree) with:



Adding the jtree to the ToolTipManager made it all work..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic