FULL PRODUCT VERSION :
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Multi-monitor setup, NVIDIA Quadro FX 770M
A DESCRIPTION OF THE PROBLEM :
At the first time a tooltip should show up in a Swing application, the application freezes. The duration of the freeze depends on the number of screen devices. For example in a dual screen environment the freeze time gets doubled.
After a short investigation the method getDrawingGC() in class TooltipManager causes this problem. At the first time this method gets called, each call to GraphicsDevice.getConfigurations() hangs about 5 or more seconds. In Java 7 Update 25 and earlier versions the call of this method takes less than 100 ms.
It seems to be caused by JDK-7123767 which was fixed in update 40.
This bug is even reproducible without the TooltipManager as shown in the source code of the executable test case.
REGRESSION. Last worked in version 7u25
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The issue can be reproduced with any java application.
For example the button demo in the Java tutorials also show this behaivor (http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html#ButtonDemo).
EXPECTED VERSUS ACTUAL BEHAVIOR :
Tooltip should not freeze application.
Application freezes imediatelly for about 10 seconds in dual screen environment.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test
public static void main(String args)
long startTime = System.currentTimeMillis();
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice devices = env.getScreenDevices();
for (GraphicsDevice device : devices)
System.out.println(String.format("Consumed time: %d ms", System.currentTimeMillis() - startTime));
---------- END SOURCE ----------