FileDocCategorySizeDatePackage
Faces.javaAPI DocExample3833Mon Apr 06 18:10:26 BST 1998c13.swing

Faces

public class Faces extends JPanel

Fields Summary
static Icon[]
faces
JButton
jb
JButton
jb2
boolean
mad
Constructors Summary
public Faces()

    
    jb.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e){
        if(mad) {
          jb.setIcon(faces[3]);
          mad = false;
        } else {
          jb.setIcon(faces[0]);
          mad = true;
        }
        jb.setVerticalAlignment(JButton.TOP);
        jb.setHorizontalAlignment(JButton.LEFT);
      }
    });
    jb.setRolloverEnabled(true);
    jb.setRolloverIcon(faces[1]);
    jb.setPressedIcon(faces[2]);
    jb.setDisabledIcon(faces[4]);
    jb.setToolTipText("Yow!");
    add(jb);
    jb2.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e){
        if(jb.isEnabled()) {
          jb.setEnabled(false);
          jb2.setText("Enable");
        } else {
          jb.setEnabled(true);
          jb2.setText("Disable");
        }
      }
    });
    add(jb2);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    Show.inFrame(new Faces(), 300, 200);