Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use the MouseListener

Status
Not open for further replies.

Julzzey

Programmer
Sep 2, 2002
19
US
Hi, I'm trying to figure out the MouseListener, but I'm lost. I have a grid that when I click on it I need to get the x and y coordinates. Any help would be appreciated. I'm new at Java and I can't figure out what class to extend and all that fun stuff. Thanks!
 
Hi Julzzey:

First, as jfryer stated, use the resources from java.sun.com, tutorials and api. I'm sure you can find the information there.

check this link:


I recommend you to chek the MouseAdapter class, you can extend it and override the method of your interest. You can get the x, y coordinates from the MouseEvent and then do something in your code.

See:


Hope it helps. Pedro Andrés Solorzano
Pontificia Universidad Javeriana
Bogotá, Colombia, SurAmérica.
 
Thanks! I actually found that site and got it to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top