Tooltip bug, JDK vs Java runtime
Tooltip bug, JDK vs Java runtime
So it looks like in JBuilder when I run my program and I hover my mouse over the data points in my chart, tooltips will pop up showing me the appropriate data residing at that point.
However, when I build my program into a jar, and launch it using the java runtime (javaw.exe), tooltips do not show when hovering over datapoints.
Mr. G?
Thanks,
Craig.
However, when I build my program into a jar, and launch it using the java runtime (javaw.exe), tooltips do not show when hovering over datapoints.
Mr. G?
Thanks,
Craig.
Re: Tooltip bug, JDK vs Java runtime
Strange...it's working OK for me, but then I'm running Linux. Anyone else seeing this problem?
Regards,
DG.
Regards,
DG.
Re: Tooltip bug, JDK vs Java runtime
David, do you have access to a windows box at all? If so, I can post a link of an AVI demonstrating the bug if you'de like.
As well, I'll look into putting some debug statements around the relavent parts in JFreeChart and see what event is not fireing in the runtime.
Craig.
As well, I'll look into putting some debug statements around the relavent parts in JFreeChart and see what event is not fireing in the runtime.
Craig.
Re: Tooltip bug, JDK vs Java runtime
I've found a bug report, let me know if they apply in JFreeChart's case:
http://developer.java.sun.com/developer ... 11933.html
Here are the details:
<b>Dynamic tooltip does not work anymore with 1.4 Beta2</b>
JComponents that override getToolTipText() must call
ToolTipManager.sharedInstance().registerComponent(this).
This was true in 1.3.1 as well. Calling setToolTipText()
had the side effect in 1.3.1 of registering the component,
but in 1.4 the call has been optimized to skip registering
if getToolTiptext() already returns non-null. This behavior
should be modified slightly to be backwards compatible.
xxxxx@xxxxx 2001-10-09
I tried using this in ChartPanel.getToolTipText() but haven't been able to get it to work yet. Hopefully this will point you in the right direction David.
Craig
http://developer.java.sun.com/developer ... 11933.html
Here are the details:
<b>Dynamic tooltip does not work anymore with 1.4 Beta2</b>
JComponents that override getToolTipText() must call
ToolTipManager.sharedInstance().registerComponent(this).
This was true in 1.3.1 as well. Calling setToolTipText()
had the side effect in 1.3.1 of registering the component,
but in 1.4 the call has been optimized to skip registering
if getToolTiptext() already returns non-null. This behavior
should be modified slightly to be backwards compatible.
xxxxx@xxxxx 2001-10-09
I tried using this in ChartPanel.getToolTipText() but haven't been able to get it to work yet. Hopefully this will point you in the right direction David.
Craig
Re: Tooltip bug, JDK vs Java runtime
Any headway on this David? I know you have a lot on your plate.
Thanks,
Craig
Thanks,
Craig
Re: Tooltip bug, JDK vs Java runtime
Hi Craig,
I've modified this method in ChartPanel:
public void setGenerateToolTips(boolean flag) {
this.info.setGenerateToolTips(flag);
if (flag==true) {
ToolTipManager.sharedInstance().registerComponent(this);
}
else {
ToolTipManager.sharedInstance().unregisterComponent(this);
}
}
...and added this to the constructor (right after the other enableEvents call):
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
That doesn't appear to break anything on Linux/JDK1.3, but I don't have easy access to Windows or JDK1.4. Can you (or anyone) test if the above solves the problem?
Regards,
DG.
I've modified this method in ChartPanel:
public void setGenerateToolTips(boolean flag) {
this.info.setGenerateToolTips(flag);
if (flag==true) {
ToolTipManager.sharedInstance().registerComponent(this);
}
else {
ToolTipManager.sharedInstance().unregisterComponent(this);
}
}
...and added this to the constructor (right after the other enableEvents call):
enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
That doesn't appear to break anything on Linux/JDK1.3, but I don't have easy access to Windows or JDK1.4. Can you (or anyone) test if the above solves the problem?
Regards,
DG.
Re: Tooltip bug, JDK vs Java runtime
Affraid to say it still doesn't work 
David, you should consider either:
A) Buying a vmware license and running Windows out of a window on your linux system
B) Setting up a windows box and VNC'ing into it to run tests.
The former would probably be the best solution as VMWare can be setup to run multiple versions of windows fairly easily.
Craig.

David, you should consider either:
A) Buying a vmware license and running Windows out of a window on your linux system
B) Setting up a windows box and VNC'ing into it to run tests.
The former would probably be the best solution as VMWare can be setup to run multiple versions of windows fairly easily.
Craig.