This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 22088

Summary: Events are not created with proper timestamp
Product: qa Reporter: Jiri Skrivanek <jskrivanek>
Component: CodeAssignee: issues@qa <issues>
Status: CLOSED FIXED    
Severity: blocker CC: mkubec
Priority: P1    
Version: 3.x   
Hardware: Sun   
OS: Solaris   
Issue Type: DEFECT Exception Reporter:

Description Jiri Skrivanek 2002-04-04 10:25:24 UTC
EventDispatcher now creates events like this:

MouseEvent event = new MouseEvent(component, id,
0, mods, x, y, clickCount, popup);

KeyEvent event = new KeyEvent(component, id, 0,
mods, keyCode);

0 stands for timestamp. But IDE has its own
double-click detection where it checks time
difference between single clicks and if time
difference is less than a constant, it assumes it
is a double-click. It makes some tests to fail.
It would be better to create events with proper
timestamp:

390: MouseEvent event = new MouseEvent(component,
id, System.currentTimeMillis(), mods, x, y,
clickCount, popup);
427:	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis(), mods, keyCode);
440:	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis(), mods, keyCode,
keyChar);
Comment 1 Alexandre Iline 2002-04-15 05:36:21 UTC
Just like Jiri said:

System.currentTimeMillis() instead of 0 as 
timestamp.
Comment 2 Alexandre Iline 2002-04-15 08:32:58 UTC
390c390,391
< 	MouseEvent event = new MouseEvent(component, id, 0, mods, x, y,
clickCount, popup);
---
> 	MouseEvent event = new MouseEvent(component, id,
System.currentTimeMillis(), 
> 					  mods, x, y, clickCount, popup);
427c428,429
< 	KeyEvent event = new KeyEvent(component, id, 0, mods, keyCode);
---
> 	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis()
> 				      , mods, keyCode);
440c442,443
< 	KeyEvent event = new KeyEvent(component, id, 0, mods, keyCode,
keyChar);
---
> 	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis(), 
> 				      mods, keyCode, keyChar);
Comment 3 Jiri Skrivanek 2002-04-15 17:29:53 UTC
Verified.