Description: A font chooser dialog which suports setting the size, bold and italic properties of the font.
Copyright: Copyright (c) 2011
NOTE: This JavaDoc file was post processed with Microsoft FrontPage and regenerating the file will cause the graphics and format changes to be lost.
Constructor Detail |
public FontChooser(java.awt.Frame parent)
A font chooser that allows users to pick a font by name, set the size and select whether the font should be bold and/or italic.
It can be called with FontChooser fc = new FontChooser(this);
if a frame is avialable or it can be called with: FontChooser fc = new FontChooser(null);
if a frame is not available.
This dialog is an adaptation of the font chooser presented in Java Swing by Robert Eckstein, Marc Loy & Dave Wood, O'Reilly, Sebastopol, CA 1998, ISBN 1-56592-455-X. See pages 381-387. The fixed list of fonts approach used by the O'Reilly example was replaced by the more general getting a list of all available fonts as described on pages 788-791 of Java for Dummies by Doug Lowe and Barry Burd, Wiley Publishing, Inc. 2007.
parent
- The parent Frame from which this dialog was called. If the dialod is called with a valid parent the dialog will be positioned over the center of the parent. If a null
is passed instead of a parent then the dialog will be located at the upper left of the screen.Method Detail |
public java.awt.Font getNewFont()
Usage example:
FontChooser dlg = new FontChooser(this);
Font font = dlg.getNewFont();
System.out.println("font=" + font);
public java.lang.String toString()