|
|
Classification: |
Java |
Category: |
AWT |
Created: |
01/03/2001 |
Modified: |
06/22/2001 |
Number: |
FAQ-0547 |
Platform: |
ER5 |
|
Question: If I drag a pointer off a button, how do I know when the mouse button is released? Since in ER5 once the pointer is no longer
over a component, mouse_up events are no longer passed to that component.
Answer: The Java 1.1.8 specification is agnostic as to which components subsequent mouse events are passed to once the pointer has
moved off the component. In ER5, when the mouse is released a mouse_up event is not passed to the component if the pointer is no longer over that
component. Whereas in the v6 Runtime the mouse_up event is passed to the original component even if the pointer is no longer over that
component.
- java.awt.Buttons overcome this problem because, even in ER5, after being "pressed" they use a native method - SetPointerGrab()
- which allows them to be notified them whenever the pointer is lifted up, irrespective of where, so can then redraw themselves
as "released".
- Lightweight button components in ER5 by contrast have no reliable work around, from Java or native code, allowing them to
be notified of pointer events after the pointer has been dragged off.
|
|
|