On Wednesday, August 15, 2012 1:28:00 PM UTC-7, markspace wrote:
On 8/15/2012 12:45 PM, FredK wrote: > I would like to be able to do
both. The user clicks on a "Select" > button, then I want to let
her move the mouse until it is over some > component, then click
there to identify the component of interest. I > do not want that
component to get a mouse event; I only want to know > the
coordinates of the click. > What the goal of this request? If
you're looking to copy mouse clicks, Java has a "Robot" that
records mouse clicks and can replay them. You might also look at
the Robot code to see how they implement it.
<http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html>
An app similar to EditRes, but for Java apps instead of X/Motif.
I generate a tree showing all of the GUI components of the app. I
want the user to be able to point to a component in the app, then
that item will be displayed as selected in the tree. So when the user
presses the "Select" button, the cursor changes (say, to "hand"), my
comnponent grabs the mouse so only it gets events; then thye user
moves the cursor until is over some component anywhere on the screen,
and clicks there. My component receives the press event and figures
out what component it is over and highlights the tree node that
represents that component. I do not want the press event to be sent
to the component under the click.
application. You could then determine the component that the mouse was
over and its position. You can even determine the absolute position,
the component, etc.