|
Well I tryed your solution, and ...... back to the
same point,No tooltips! the JList component
behaves like if it has one of these transparent panel on top to catch all mouse
events, so the JLabel items never know the mouse is over them. Registering them
to the ToolTipManager has no effect.
here is my extension of the DefaultListCellRenderer
class
class MyListCellRenderer extends
DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list,Object value,int index,boolean sel,boolean focus) { Component c = super.getListCellRendererComponent(list,value,index,sel,focus); if (c instanceof JLabel) { // System.out.println("coucou "+String.valueOf(index)); // ToolTipManager.sharedInstance().registerComponent((JLabel)c); ((JLabel)c).setToolTipText("My tooltip for index "+String.valueOf(index)); } return c; } } thanks
|
- Tooltips in JList Arnaud Hallais
- RE: Tooltips in JList Jonathan Oddy
- Re: Tooltips in JList Greg Munt
- Re: Tooltips in JList Arnaud Hallais
- Re: Tooltips in JList Marijn H. van der Ploeg
- Re: Tooltips in JList Arnaud Hallais
- RE: Tooltips in JList thanhnam_java
- Re: Tooltips in JList Greg Munt
