jbcl.control Package
java.lang.Object +----com.borland.jbcl.control.FontChooser
Variables Constructors Properties Methods Event Listeners
Implements WindowListener, Serializable, EventListener
The FontChooser
component displays a font dialog box that enables the user to specify a font.
The dialog box contains a list control that lists all the available fonts on the system. The user selects a font from the list. The user can also specify the size of the font and whether the font is boldfaced and/or italicized. The dialog box displays text that depicts how the font selections appear.
To display the dialog box at runtime, call the show()
method or set the visible
property to true. When the user selects a font, the selection is stored in the value
property.
The dialog box has two buttons, OK and Cancel. Which button the user chooses to put away the dialog box is stored as the value of the result
property. The title
property contains the text that appears on the title bar of the dialog box's frame.
You can make the FontChooser
component appear at design time:
FontChooser
component on the UI Designer or on the Component Tree.
frame
property to this in the Component Inspector.
visible
property to true.
protected transient ActionMulticaster actionMulticaster
public static final int CANCEL = ButtonDialog.CANCELIndicates the user chose the Cancel button.
protected FontChooserDialog dialog
protected Frame frame
public static final int OK = ButtonDialog.OKIndicates the user chose the OK button.
protected int result
protected String title
protected Font value
public FontChooser()Creates a new font chooser dialog box with no specified frame and no title bar text. No initial font is selected.
public FontChooser(Frame frame)Creates a new font chooser dialog box, specifying the frame as the parent, with no title bar text. No initial font is selected.
Parameters:
frame
public FontChooser(Frame frame, String title)Creates a new font chooser dialog box using the specified frame and title bar text. No initial font is selected.
Parameters:
frame
title
public FontChooser(Frame frame, String title, Font value)Creates a new font chooser dialog with the specified frame, title, and initial font.
Parameters:
frame
title
value
public Frame getFrame() public void setFrame(Frame frame)The parent frame for the font chooser dialog box.
public int getResult() public void setResult(int i)
Stores which button of the dialog box was clicked: CANCEL or OK.
public String getTitle() public void setTitle(String title)The title text of the font chooser dialog box, usually shown in the title bar.
public Font getValue() public void setValue(Font value)The active font value. Typically, this value determines the font that is initially displayed when the dialog box appears.
public boolean isVisible() public void setVisible(boolean visible)Determines whether the dialog box is visible or invisible. If true, the dialog box is visible; otherwise, it is false.
public void show()Displays a font chooser dialog box (if the default constructor was invoked), registers itself as a listener for window events, and shows the dialog.
public void addActionListener(ActionListener l) public void removeActionListener(ActionListener l)