All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----java.awt.Window | +----java.awt.Dialog | +----gjt.FontDialog
FontDialog contains a preview panel which previews the currently selected font. Updating of the preview panel is triggered by a preview button at the bottom of the dialog.
FontDialog contains 3 methods which define the labels for the buttons it contains:
By default the 3 methods return "Preview", "Ok" and "Cancel" respectively. FontDialog may be extended and the 3 methods overridden to customize the labels displayed in the buttons.
FontDialog uses Toolkit to get a list of fonts by invoking Toolkit.getFontList(). This is done in the getFontNames() method, which may be overridden by extensions of FontDialog in case the standard set of font names are inadequate.
Finally, font sizes are obtained by the getFontSizes() method. FontDialog defines 8 sizes by default: 8, 12, 14, 16, 18, 24, 48 and 64. Extensions of FontDialog may override getFontSizes() to provide a different list of sizes.
See gjt.test.FontDialogTest for an example of an extension of FontDialog which overrides the methods discussed above.
public FontDialog(Frame frame, DialogClient client, Font font, boolean modal)
public boolean handleEvent(Event event)
public String[] getFontNames()
public String[] getFontSizes()
public String getPreviewButtonLabel()
public String getOkButtonLabel()
public String getCancelButtonLabel()
public void show()
public void done(Font font)
public Font getFontSelected()
public void listSelectedInPicker()
All Packages Class Hierarchy This Package Previous Next Index