Tooltip bug, JDK vs Java runtime

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Craig Tataryn

Tooltip bug, JDK vs Java runtime

Post by Craig Tataryn » Mon Jun 10, 2002 6:17 pm

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.

David Gilbert

Re: Tooltip bug, JDK vs Java runtime

Post by David Gilbert » Tue Jun 11, 2002 11:20 am

Strange...it's working OK for me, but then I'm running Linux. Anyone else seeing this problem?

Regards,

DG.

Craig Tataryn

Re: Tooltip bug, JDK vs Java runtime

Post by Craig Tataryn » Tue Jun 11, 2002 3:14 pm

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.

Craig Tataryn

Re: Tooltip bug, JDK vs Java runtime

Post by Craig Tataryn » Tue Jun 11, 2002 4:45 pm

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

Craig Tataryn

Re: Tooltip bug, JDK vs Java runtime

Post by Craig Tataryn » Thu Jun 13, 2002 3:07 am

Any headway on this David? I know you have a lot on your plate.

Thanks,

Craig

David Gilbert

Re: Tooltip bug, JDK vs Java runtime

Post by David Gilbert » Thu Jun 13, 2002 9:46 am

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.

Craig Tataryn

Re: Tooltip bug, JDK vs Java runtime

Post by Craig Tataryn » Thu Jun 13, 2002 9:15 pm

I shall, and I will report back.

Craig.

Craig Tataryn

Re: Tooltip bug, JDK vs Java runtime

Post by Craig Tataryn » Thu Jun 13, 2002 9:58 pm

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.

Locked