The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Mouse Events

Posted by Hassled on April 06, 2001 at 1:11 PM

I am creating a Java applet, in which I am distinguishing between mouse clicks and mouse pressed.

I am using mouse events to control actions. In one case I want the applet read two points indicated by mouse clicks. I can do this easily using mouseclicked() and by counting the clicks.

However, I want to do the same thing using mousepressed and mousereleased. So there is a choice. Click on two points, or press at one and release at the other.

The problem is that I can do either independently, but if I try to include both in the applet the mousepressed event appears to supercede the mouseclicked event, so only it works.

Any suggestions?




Replies:
  • Suggestion Kishori Sharan April 06, 2001 at 1:32 PM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us