FileDocCategorySizeDatePackage
PictureButton.javaAPI DocExample847Mon May 01 14:41:52 BST 2000None

PictureButton

public class PictureButton extends JFrame

Fields Summary
Constructors Summary
public PictureButton()

    super("PictureButton v1.0");
    setSize(200, 200);
    setLocation(200, 200);

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

    Container content = getContentPane(  );
    content.setLayout(new FlowLayout(  ));
    content.add(button);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    JFrame f = new PictureButton(  );
    f.addWindowListener(new WindowAdapter(  ) {
      public void windowClosing(WindowEvent we) { System.exit(0); }
    });
    f.setVisible(true);