Hi
I have this code to place an image over the standard JButton. But if the image is smaller or transparent, the underlying standard image is still seen. Is it possible to remove this image and just have the background of the panel showing?
public class ImageButton extends JButton {
public ImageButton(ImageIcon icon, String text) {
setSize(icon.getImage().getWidth(null),
icon.getImage().getHeight(null));
setIcon(icon);
setMargin(new Insets(0,0,0,0));
setIconTextGap(0);
setBorderPainted(false);
setBorder(null);
setText(text);
setHorizontalTextPosition(this.CENTER);
}
/code]
Thanks for any help.
Chris