views:

97

answers:

1

Hi

I try to create a hotspot by Extends of canvas and I try to add it on a panel which is painted by images. So I must draw an icon (image) instead of clear rectangle of the screen. To do that I override the paint method to draw the icon I want to use. So far there is no problem; the hotspot works correctly and the icon is painted in the true size I want (32 x 24 pixels).

I try to add this hotspot after painting an image on the my panel in mypanel.paint(g) that override too.

The problem is that I use a car icon that has no background! (I hope you can understand me) Just the car icon must be shown on the panel that is painted with my images. But an unwanted rectangle is created around the icon and makes a bad view. How I can paint my icon on the panel without that background? Please help me.

A: 

hi the problem solve by using JLable component, i extends JLabeles and set an icon to it, then i add a mouse listener to get mouse clicked event and then set Hand curser to it, so the hotspot as a true HotSpot !!

sirvan