Class PartialFontChooserPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PartialFontChooserPanel extends JPanel
A panel for choosing a font from the available system fonts. Allows hiding size and/or style (bold, etc)
Author:
jldominguez
See Also:
  • Field Details

    • SIZES

      public static final String[] SIZES
      The font sizes that can be selected.
    • localizationResources

      protected static ResourceBundle localizationResources
      The resourceBundle for the localization.
  • Constructor Details

    • PartialFontChooserPanel

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

    • getSelectedFont

      public Font getSelectedFont()
      Returns a Font object representing the selection in the panel.
      Returns:
      the font.
    • getSelectedName

      public String 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.