• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image Click Event

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic