Rose, Basically, all you have to do is extend Component, Button, Panel, Canvas... any of the AWT types you could use to draw an image on... you would send the image into your new class via the constructor, or a set method, and have the new component paint the image in it's paint() method... you would need to make it create ActionEvents( since that's what buttons create ) when it is clicked on... you would probably do this by making the new class implement MouseListener and KeyListener( to get mouse clicks and key presses on this new class ) and have it draw the new class differently( i.e. different image, border change, something to show it is "pressed" ) and have it create the ActionEvent... Then you just use this new AWT component in your applet or application. I know that I was kind of sketchy on the details... please ask if something is not understandable, or if you need an example. HTH, -Nate
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Rose, Here is an example of some code to create a button with an image on it... if it meets your needs, great! If not, hopefully it can be modified to do just what you want!
Just use it like a normal Button in your applets or applications! Email me or post on here if you have any problems with it! HTH, -Nate
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
Gift giving made easy with the permaculture playing cards