Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image Click Event

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an applet in which I have one Image. I want to do this:
If somebody click images, I want to call another HTML page from the server with the use of URL method.
MY QUESTION:
Please LET ME KNOW IS THERE IMAGE CLICK EVENT(LIKE WE HAVE BUTTON CLICK)?? If not, is there any other alternative for image click ??
Thanks,
Angela
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Angela,
It's called MouseClicked. I assume you have drawn your image into the applet or into a panel. Add a mouse listener to your applet or panel. In the method (mouseClicked) you can get the x and y locations which where clicked. Compare that to the image location + image width and heights to figure out if the clicked happened on the image or not.
Regards,
Manfred.
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Manfred,
Angela

Originally posted by Manfred Leonhardt:
Hi Angela,
It's called MouseClicked. I assume you have drawn your image into the applet or into a panel. Add a mouse listener to your applet or panel. In the method (mouseClicked) you can get the x and y locations which where clicked. Compare that to the image location + image width and heights to figure out if the clicked happened on the image or not.
Regards,
Manfred.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic