🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #13072

Re: How to get cursor position on screen?

#13072
From: Tad Frysinger
Date: Fri, 02 Oct 1998 00:00
20 lines
1205 bytes
In article <6v1hld$2oc9@forums.borland.com>, linkk@ms1.accmail.com.tw 
says...
> How to get cursor position on screen?
> 
> 
> 
> 
MouseEvents are defined with a getX() and getY() method that returns the 
position of the cursor.  Probably the easiest way to do this is to set up 
a mouse motion listener.  The problem with that approach is that 
listeners are component specific: if you set it up at the frame level, 
when the mouse goes over a component, you won't get the event.  You can 
set it up for each component then translate the values at the component 
level (as they are relative to the parent).

Not a pretty picture, I agree, if you are trying to get the location no 
matter where the mouse goes.

Tad Frysinger
[TeamB]
Technical Details
Message-ID: <MPG.107e870dc78d745b98991c@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6v1hld$2oc9@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,8c12370b73b7ec11
X-Google-Attributes: gid111d45,public
From: tfrysinger@uswest.net (Tad Frysinger)
Subject: Re: How to get cursor position on screen?
Date: 1998/10/02
Message-ID: <MPG.107e870dc78d745b98991c@forums.borland.com>
X-Deja-AN: 397038365
References: <6v1hld$2oc9@forums.borland.com>
Organization: FreeZone Enterprises
Newsgroups: borland.public.jbuilder.java.swing