FileDocCategorySizeDatePackage
FontPicker.javaAPI DocExample1039Thu Oct 24 20:14:24 BST 2002None

FontPicker

public class FontPicker extends JFrame

Fields Summary
Color
c
Constructors Summary
public FontPicker()

    super("JColorChooser Test Frame");
    setSize(200,100);
    final JButton go = new JButton("Show FontChooser");
    go.addActionListener(new ActionListener() {
      final FontChooser chooser = new FontChooser(FontPicker.this);
      boolean first = true;
      public void actionPerformed(ActionEvent e) {
        chooser.setVisible(true);
        // If we got a real font choice, then update our go button
        if (chooser.getNewFont() != null) {
          go.setFont(chooser.getNewFont());
          go.setForeground(chooser.getNewColor());
        }
      }
    });
    getContentPane().add(go);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    FontPicker fp = new FontPicker();
    fp.setVisible(true);