Class FontChoosePanel

All Implemented Interfaces:
ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListSelectionListener

public class FontChoosePanel extends JPanel implements ListSelectionListener, ItemListener
A dialog for a label and a font.
Author:
heddle
See Also:
  • Field Details

    • displayText

      protected String displayText
  • Constructor Details

    • FontChoosePanel

      public FontChoosePanel(String title, Font inFont)
      Construct a FontChooser -- Sets title and gets array of fonts on the system. Builds a GUI to let the user choose one font at one size.
      Parameters:
      inFont - the initial font to display.
  • Method Details

    • createScrollLists

      public void createScrollLists(JPanel panel)
      Create the font scroll lists *family and size) and add them to the given panel.
      Parameters:
      panel - the panel to hold the lists.
    • previewFont

      protected void previewFont()
      Called from the action handlers to get the font info, build a font, and set it.
    • getSelectedFont

      public Font getSelectedFont()
      Returns the font represented by the current family, size, and style controls.
      Returns:
      the selected font
    • valueChanged

      public void valueChanged(ListSelectionEvent lse)
      One of the list's was selected. Redo the preview.
      Specified by:
      valueChanged in interface ListSelectionListener
      Parameters:
      lse - the list selection event.
    • itemStateChanged

      public void itemStateChanged(ItemEvent ise)
      One of check boxes was selected.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      ise - the state changed event.