Applix has requested an API to return the location of the mouse on the desktop. They would use this to place windows at the mouse location.
=============================================================
Another report:
I would like to obtain the current mouse location without waiting for any events.
I'm looking for something simple, like:
public class java.awt.Mouse
{
/**
* @return A Point representing the mouse's current X and Y coordinates.
*/
public static native Point getCurrentPosition();
}
An example of why this is useful is:
1/ Load up Netscape
2/ Go to a really long page that has lots of URLs
3/ Click anywhere on the page that isn't over an URL
4/ Let go of the mouse; don't ever touch it
5/ Use the cursor keys (Up Arrow, Down Arrow, etc.) to scroll the long
page up and down
6/ Watch the mouse cursor change as an URL scrolls behind the mouse cursor
(again, without so much as breathing on the mouse)
In order for Netscape to change the shape of the mouse cursor, it needs
to know if the mouse's current location on the screen is over an URL or
not. To do this, whenever you scroll the page with the cursor keys
(which are far from being a Mouse Event), Netscape must query to see
where the mouse is currently situated on the screen. If that location is
on top of an URL, it changes the mouse shape to a Hand Pointer, or some
such thing.
brian.klock@eng 1997-11-12
=============================================================
=============================================================
Another report:
I would like to obtain the current mouse location without waiting for any events.
I'm looking for something simple, like:
public class java.awt.Mouse
{
/**
* @return A Point representing the mouse's current X and Y coordinates.
*/
public static native Point getCurrentPosition();
}
An example of why this is useful is:
1/ Load up Netscape
2/ Go to a really long page that has lots of URLs
3/ Click anywhere on the page that isn't over an URL
4/ Let go of the mouse; don't ever touch it
5/ Use the cursor keys (Up Arrow, Down Arrow, etc.) to scroll the long
page up and down
6/ Watch the mouse cursor change as an URL scrolls behind the mouse cursor
(again, without so much as breathing on the mouse)
In order for Netscape to change the shape of the mouse cursor, it needs
to know if the mouse's current location on the screen is over an URL or
not. To do this, whenever you scroll the page with the cursor keys
(which are far from being a Mouse Event), Netscape must query to see
where the mouse is currently situated on the screen. If that location is
on top of an URL, it changes the mouse shape to a Hand Pointer, or some
such thing.
brian.klock@eng 1997-11-12
=============================================================
- duplicates
-
JDK-4717900 Provide method to determine mouse location
- Closed
- relates to
-
JDK-4706304 REGRESSION: JPopupMenu doesn't highlight selection on initial click
- Closed