Re: hotspots and mouseovers?


2003-06-26 03:03:25 PM
jbuilder19
"Nechama Shuchatowitz" < XXXX@XXXXX.COM >writes:
Quote
Well, my graphics-guy made me a nice looking skin for the application, and
he already drew in the buttons, etc, so they look nice. Is it possible for
me to "cut up" the graphic into 'hotspot' areas, sort of like you do with
web pages, and to have the actionListener code from each of my buttons be
'attached' to that hotspot area on the graphic?
Yes, use the AWT area "components" like Rectangle to define the
hostpots. Then attach a MouseListener to the component the graphics is
painted on, and check each "hotspot" on a click to see if the
coordinates are within the shape.