Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I respond to a JButton being held down?

843806May 10 2008 — edited May 10 2008
I want to make a JButton comparable to one of the JSpinner buttons. You hold it down with the moose button, a value increments, and if you hold it down for more than a second or so it starts incrementing automatically at a reasonable rate until you release the mouse button. But ActionListener only responds to a single click. MouseListener also only responds to singular events: mouseClicked(), MousePressed(), mouseReleased(), etc. None have a mouseHeldDown() method. Is there any way to do this (hopefully with threads) ??
Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2008
Added on May 10 2008
5 comments
771 views