K
k0m0r
Hi.
I've been trying to solve it myself, but I simply don't get it
I've got a JSlider and I need to print it's value in a tooltip that
appears at the cursor position every time mouse enters the
slider or changes its value (the tooltip should "chase" mouse
position).
I've been trying this:
class JProxySlider extends JSlider
implements ChangeListener {
JToolTip tip = new JToolTip();
JProxySlider() {
.....
tip.setComponent(this);
this.addChangeListener(this);
}
public void stateChanged(ChangeEvent e) {
tip.setToolTipText(this.getValue()+"");
tip.setVisible(true);
}
}
but I can't figure out how to fire the tooltip popup.
I found also ToolTipManager, but I can't force it
to work with this one.
Please help.
k0m0r
I've been trying to solve it myself, but I simply don't get it
I've got a JSlider and I need to print it's value in a tooltip that
appears at the cursor position every time mouse enters the
slider or changes its value (the tooltip should "chase" mouse
position).
I've been trying this:
class JProxySlider extends JSlider
implements ChangeListener {
JToolTip tip = new JToolTip();
JProxySlider() {
.....
tip.setComponent(this);
this.addChangeListener(this);
}
public void stateChanged(ChangeEvent e) {
tip.setToolTipText(this.getValue()+"");
tip.setVisible(true);
}
}
but I can't figure out how to fire the tooltip popup.
I found also ToolTipManager, but I can't force it
to work with this one.
Please help.
k0m0r