Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2004

Tip: Looking for answers? Try searching our database.

mouseReleased without mouseClicked?

Thread view: 
Nikita Tovstoles - 03 Mar 2004 02:14 GMT
Hi,

i'm writing an app with jdk1.1.8 and i have an awt widget with two
mouselisteners listening on it:

-one listening for mouseClicked
-another listening for mousePressed and mouseReleased

the intention is to do one thing if user clicks on widget and another
if user holds the button down for a while before releasing.

The problem is that even if i hold the button down for a while,
whenever i release mouseClicked is triggered. How can i get around
that?

I thought mouseClicked is supposed to only be triggered when time
difference between mousePressed and mouseReleased is 'short'...

thanks
-nikita
ak - 03 Mar 2004 08:04 GMT
> I thought mouseClicked is supposed to only be triggered when time
> difference between mousePressed and mouseReleased is 'short'...

no, "mouseClicked" is if you press and release mouse over same component.

> The problem is that even if i hold the button down for a while,
> whenever i release mouseClicked is triggered. How can i get around
> that?
you should compare time of mousePressed and mouseClicked then you know how
long it took.

____________

http://reader.imagero.com the best java image reader.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.