Tuesday, June 12, 2001 05:57 PM
You're better off coding your own component (call it ImageButton) that
shows an image (it just draws one when
paint() is called) and sends an ActionEvent when it is clicked.
You could (in theory) subclass java.awt.Button and do the draw yourself, but you'll run into severe problems drawing on regular awt components (other than containers and canvas) as AWT doesn't make guarantees that it'll tell you everytime the "native appearance" of that control changes - for example, you don't get told when a Motif button is in the depressed state, so if you try to change the appearance of a button by drawing on it, the "regular" appearance
wins on motif.