import java.awt.*; import java.awt.event.*; import javax.swing.*; public class PictureButton extends JFrame { JLabel button; public PictureButton( ) { setSize(200, 200); setLocation(200, 200); Icon icon = new ImageIcon("mobile.jpg"); button = new JLabel(); button.setIcon(icon); Container content = getContentPane( ); content.add(button); } public static void main(String[] args) { JFrame f = new PictureButton( ); f.addWindowListener(new WindowAdapter( ) { public void windowClosing(WindowEvent we) { System.exit(0); } }); f.setVisible(true); } }