How can I place an image on an AWT button?
Created May 4, 2012
Sandip Chitale
Subclass Button and override the paint method.
public void paint(Graphics g) { // call super's paint method super.paint(g); g.drawImage(...); // use any of the many drawImage variants here ! }Most likely you will also have to override
public Dimension getPreferredSize()
public Dimension getMinimumSize()
public Dimension getMaximumSize()
also so that the layout managers can deal with the size of the Button correctly.