Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: FredK Newsgroups: comp.lang.java.gui Subject: Re: How to grab pointer Date: Wed, 15 Aug 2012 13:40:30 -0700 (PDT) Organization: http://groups.google.com Lines: 23 Message-ID: <1b554d4b-ca3a-459d-993e-5225c479b277@googlegroups.com> References: <6d596f35-fd58-4593-b40c-7cd54dbe23f1@googlegroups.com> NNTP-Posting-Host: 130.76.32.218 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1345063705 23096 127.0.0.1 (15 Aug 2012 20:48:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 15 Aug 2012 20:48:25 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.76.32.218; posting-account=_7xgmwoAAADi7iXKBO-oX5zbCfSzsCV0 User-Agent: G2/1.0 X-Received-Bytes: 2605 Xref: csiph.com comp.lang.java.gui:5229 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 mo= use until it is over some > component, then click there to identify the com= ponent 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 r= equest? If you're looking to copy mouse clicks, Java has a "Robot" that rec= ords mouse clicks and can replay them. You might also look at the Robot cod= e to see how they implement it. 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" bu= tton, 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 co= mponent anywhere on the screen, and clicks there. My component receives the= press event and figures out what component it is over and highlights the t= ree node that represents that component. I do not want the press event to b= e sent to the component under the click.