Hey
Im trying to write some simple code that will determine the difference between a mouse click and a mouse unclick. So when the user clicks and holds a button, it would print("hello") untill they released the button.
is this possible?
thanks
Joe
Printable View
Hey
Im trying to write some simple code that will determine the difference between a mouse click and a mouse unclick. So when the user clicks and holds a button, it would print("hello") untill they released the button.
is this possible?
thanks
Joe
Hello Joe2003.
Let your frame or window class implement the MouseListener interface. You will have to implement all the methods of the MouseListener interface. There you will see the mousePressed() and mouseReleased() methods. Add your code there. Remember that you must add the MouseListener to the button, for example:
Just ask if you need more detailed help. ;)Code:myButton.addMouseListener(this);
thanks for that tim, works great. Cheers