JDK-7096375 : Swing ignores first click after decreasing system's time
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7,8u92,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86
  • Submitted: 2011-09-29
  • Updated: 2024-10-11
  • Resolved: 2016-07-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b131Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Windows 7 64bit [ version 6.1.7600 ]

A DESCRIPTION OF THE PROBLEM :
Swing is ignoring the first click after decreasing system's date and time settings.

The complete description of the situation and a workaround is this question at StackOverflow:
http://stackoverflow.com/questions/7584924/swing-ignores-first-click-after-decreasing-windows-time

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Swing application running.
Decrease system's date and time settings (e.g. change time from 15:00 to 14:00).
Notice that the first click in the Swing application does not fire any action.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Button get pressed.
ACTUAL -
Mouse click ignored.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Change value of "multiClickThreshhold" field of "AbstractButton" class to Long.MIN_VALUE (using java.lang.reflect.*).

Comments
URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/e7b77766b1ce User: lana Date: 2016-08-10 20:19:27 +0000
10-08-2016

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/e7b77766b1ce User: psadhukhan Date: 2016-07-22 06:43:51 +0000
22-07-2016

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

- this is an issue reported against 7(7u), - there are now affected version 9 filed for this issue - 7u issues are transferred to Sustaining Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9 or 7u specific escalations might be reopen to Sustaining
10-08-2014

EVALUATION That's because of javax.swing.plaf.basic.BasicButtonListener#mousePressed implementation. To support multiClickThreshhold there is the following code: if (lastTime != -1 && currentTime - lastTime < multiClickThreshhold) { shouldDiscardRelease = true; return; } If currentTime is in past that code denies click event. We could add "&& multiClickThreshhold > 0" in that if statement to fix the problem...
14-10-2011