org.jfree.ui

Class FontChooserPanel


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.
Author:
David Gilbert

Field Summary

static String[]
SIZES
The font sizes that can be selected.
protected static ResourceBundle
localizationResources
The resourceBundle for the localization.

Constructor Summary

FontChooserPanel(Font font)
Standard constructor - builds a FontChooserPanel initialised with the specified font.

Method Summary

Font
getSelectedFont()
Returns a Font object representing the selection in the panel.
String
getSelectedName()
Returns the selected name.
int
getSelectedSize()
Returns the selected size.
int
getSelectedStyle()
Returns the selected style.
void
setSelectedFont(Font font)
Initializes the contents of the dialog from the given font object.

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

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

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.

getSelectedSize

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

getSelectedStyle

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

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.