Class FontChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FontChooser extends JPanel
The FontChooser class is a panel that displays font family, style, and size controls to allow the user to select a letter font. When the user selects a font, a property change event is fired whose property is given by FONT_PROPERTY.
Since:
3.1.7
Author:
Peter Hollemans
See Also:
  • Field Details

    • FONT_PROPERTY

      public static String FONT_PROPERTY
      The font property.
  • Constructor Details

    • FontChooser

      public FontChooser()
      Creates a new font chooser. The dialog, plain style, 12 point font is used initially.
    • FontChooser

      public FontChooser(Font font)
      Creates a new font chooser with the specified initial font.
      Parameters:
      font - the initial font for the main font chooser. If null, the dialog, plain style, 12 point font is used initially.
  • Method Details

    • getFontSelection

      public Font getFontSelection()
      Gets the font selected by this font chooser.
    • setFontSelection

      public void setFontSelection(Font newFont)
      Sets the font selected by this font chooser. The font may be null, in which case this method has no effect.
    • main

      public static void main(String[] argv)
      Tests this class.
      Parameters:
      argv - the array of command line parameters.