FileDocCategorySizeDatePackage
FancyButton.javaAPI DocExample1152Thu Oct 24 20:14:20 BST 2002None

FancyButton

public class FancyButton extends JButton

Fields Summary
Constructors Summary
public FancyButton(Icon icon, Icon pressed, Icon rollover)

    super(icon);
    setFocusPainted(false);
    setRolloverEnabled(true);
    setRolloverIcon(rollover);
    setPressedIcon(pressed);
    setBorderPainted(false);
    setContentAreaFilled(false);
  
Methods Summary
public static voidmain(java.lang.String[] args)


    FancyButton b1 = new FancyButton(
      new ImageIcon("images/redcube.gif"),
      new ImageIcon("images/redpaw.gif"),
      new ImageIcon("images/reddiamond.gif"));
    FancyButton b2 = new FancyButton(
      new ImageIcon("images/bluecube.gif"),
      new ImageIcon("images/bluepaw.gif"),
      new ImageIcon("images/bluediamond.gif"));
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c = f.getContentPane();
    c.setLayout(new FlowLayout());
    c.add(b1);
    c.add(b2);
    f.pack();
    f.setVisible(true);