Name: gm110360 Date: 07/21/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
Also a problem with 1.4.2.
ADDITIONAL OS VERSION INFORMATION :
Linux gaz 2.4.18 #18 SMP Mon Feb 24 11:42:05 EST 2003 i686 unknown
A DESCRIPTION OF THE PROBLEM :
Double click speed on Linux KDE in swing components does not follow preferences set in the KDE Control panel. This works fine for Solaris CDE, so it is not a UNIX issue. No matter what speed I set the double-click interval to, the double click speed recognized by swing is much much faster (too fast). This is a big problem because users think that their double clicks on tree nodes are getting ignored. Java appears to always be picking up that the system setting is 200 ms even when it has been set to something else. I have seen this behavior in both JTables and JTrees (assuming that it affects everything).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the app below. Note that when you run it, the double click speed from system properties is printed to system out.
Twist open a node in the tree and Double click on the sub-nodes with varying speed. Note that only really fast double clicks are recognized (there is a println in mouseReleased when an event is a doubleClick event).
Close the app and set your system pref for double click speed to be really really slow and then try again. There is no difference.
EXPECTED VERSUS ACTUAL BEHAVIOR :
I expected that the double-click speed would be controlled by the system pref set in the KDE control panel like it is in WIndows and CDE Solaris.
Double click speed is always really fast no matter what it is set to in KDE prefs. Setting the pref has no effect on the double click speed.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class TestDoubleClickInterval
private JTree fTree;
private DefaultTreeModel fModel;
private DefaultMutableTreeNode fTopNode;
JFrame f = new JFrame("Test Tree Click Behavior");
fTopNode = new DefaultMutableTreeNode("Top Level");
for (int i = 0; i < 10; i++)
treeNode = new DefaultMutableTreeNode("test"+i);
fTree = new JTree();
fModel = new DefaultTreeModel(fTopNode);
fTree.setRootVisible(false); //make top node invisible
fTree.setShowsRootHandles(true); //show tree lines
JScrollPane sp = new JScrollPane(fTree);
System.out.println("Multi Click interval " +((Integer) Toolkit.getDefaultToolkit().getDesktopProperty("awt.multiClickInterval")).intValue());
private class MyMouseAdapter extends MouseAdapter
public void mouseReleased(MouseEvent event)
if (event.getClickCount() == 2)
System.out.println("Mouse event is a double click event");
public static void main(String args)
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
The only workaround is really hacky and bound to lead to problems down the road. This would be to keep track of time between mouse clicks and when they occur within a randomly chosen threshhold (bigger than 200 ms) then the click is interpreted as a double click.
(Incident Review ID: 285909)