🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Adding global mouse listener

#10793
From: Matt Krevs
Date: Wed, 11 Aug 1999 00:00
33 lines
1701 bytes
This _might_ work

Add a ContainerListener to your top level window(s)

Whenever a component is added you will be notified.

Add your class as a MouseListener to all components that are added

Maybe a better way would be to make all components that are 'help enabled'
to implement an interface, lets call it IHelpEnabled.

That way you can configure it so that your help class only registers as a
MouseListener to all objects implementing the IHelpEnabled interface.

This interface could have one method called String getHelpText() or
something.


Jason Burton <Jason.Burton@McLeodSoftware.com> wrote in message
news:7opsfj$ala3@forums.borland.com...
> Does anyone know of a way to track mouse events at the application level?
> For example, I want the user to be able to click a "Help" button.  This
> changes their cursor into a question mark.  I want my Help class to then
> listen to mouse events to display context sensitive help the next time the
> mouse is clicked (at which time the Help class will quit listening to
mouse
> events).
>
> Any ideas?
>
> Jason
>
>
Technical Details
Message-ID: <7oqejc$b197@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7opsfj$ala3@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,2c6fb04c8324bda4
X-Google-Attributes: gid111d45,public
From: "Matt Krevs" <mattkrevs@bigpond.com.au>
Subject: Re: Adding global mouse listener
Date: 1999/08/11
Message-ID: <7oqejc$b197@forums.borland.com>
X-Deja-AN: 511252837
References: <7opsfj$ala3@forums.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Reply-To: "Matt Krevs" <mattkrevs@bigpond.com.au>
Newsgroups: borland.public.jbuilder.java.swing