FileDocCategorySizeDatePackage
PictureButton.javaAPI DocExample548Sat Apr 23 22:35:40 BST 2005None

PictureButton

public class PictureButton extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    JFrame frame = new JFrame();

    Icon icon = new ImageIcon("rhino.gif");
    JButton button = new JButton(icon);
    button.addActionListener( new ActionListener() {
      public void actionPerformed(ActionEvent ae) {
        System.out.println("Urp!");
      }
    });

    frame.getContentPane().add( button );
	frame.pack();
	frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    frame.setVisible(true);