Class FontChooserPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FontChooserPanel extends JPanel
A panel for choosing a font from the available system fonts - still a bit of a hack at the moment, but good enough for demonstration applications.
See Also:
  • Field Details

  • Constructor Details

    • FontChooserPanel

      public FontChooserPanel(Font font)
      Standard constructor - builds a FontChooserPanel initialised with the specified font.
      Parameters:
      font - the initial font to display.
  • Method Details

    • getSelectedFont

      Returns a Font object representing the selection in the panel.
      Returns:
      the font.
    • getSelectedName

      Returns the selected name.
      Returns:
      the name.
    • getSelectedStyle

      public int getSelectedStyle()
      Returns the selected style.
      Returns:
      the style.
    • getSelectedSize

      public int getSelectedSize()
      Returns the selected size.
      Returns:
      the size.
    • setSelectedFont

      public void setSelectedFont(Font font)
      Initializes the contents of the dialog from the given font object.
      Parameters:
      font - the font from which to read the properties.