you mean something like this?
import java.awt.Dimension;
import javax.swing.*;
public class ImageButton extends JButton
{
public static void main( String[] args )
{
JFrame frame = new JFrame();
ImageIcon image = new ImageIcon( "c:\\pic.gif" );
JPanel panel = new JPanel();
panel.add( new ImageButton( image ) );
frame.getContentPane().add( panel );
frame.setSize( 200, 200 );
frame.setVisible( true );
}
public ImageButton( ImageIcon im )
{
super( im );
setPreferredSize( new Dimension( 50, 50 ) );
}
}
that's the first thing that jumped to mind. if you compile and run that, then you must obviously have a "pic.gif" in your c:.
