borland Packages  Class Hierarchy  jbcl.control Package  Index 

FontChooser component

java.lang.Object
   +----borland.jbcl.control.FontChooser

About the FontChooser component

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:

  1. Drop the FontChooser component on the UI Designer or on the Component Tree.
  2. Set whatever properties you want in the Component Inspector.
  3. Set the frame property to this in the Component Inspector.
  4. Set the visible property to true.


FontChooser variables

Variables implemented in this class

FontChooser constructors

FontChooser properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

FontChooser methods

Methods implemented in this class

Methods implemented in java.lang.Object

FontChooser event listeners


FontChooser variables

actionMulticaster

  protected transient ActionMulticaster actionMulticaster

CANCEL

  public static final int CANCEL = ButtonDialog.CANCEL
Indicates the user chose the Cancel button.

dialog

  protected FontChooserDialog dialog

frame

  protected Frame frame

OK

  public static final int OK = ButtonDialog.OK
Indicates the user chose the OK button.

result

  protected int result

title

  protected String title

value

  protected Font value

FontChooser constructors

FontChooser()

  public FontChooser()
Creates a new font chooser dialog box with no specified frame and no title bar text. No initial font is selected.

FontChooser(java.awt.Frame)

  public FontChooser(java.awt.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
The parent frame for the dialog box.

FontChooser(java.awt.Frame, java.lang.String)

  public FontChooser(java.awt.Frame frame, java.lang.String title)
Creates a new font chooser dialog box using the specified frame and title bar text. No initial font is selected.

Parameters:

frame
The parent frame for the dialog box.
title
The title bar text.

FontChooser(java.awt.Frame, java.lang.String, java.awt.Font)

  public FontChooser(java.awt.Frame frame, java.lang.String title, java.awt.Font value)
Creates a new font chooser dialog with the specified frame, title, and initial font.

Parameters:

frame
The parent frame for the dialog box.
title
The title bar text.
value
The initial selected font.

FontChooser properties

frame

 public Frame getFrame()
 public void setFrame(java.awt.Frame frame)
The parent frame for the font chooser dialog box.

result

 public int getResult()
 public void setResult(int i)

Stores which button of the dialog box was clicked: CANCEL or OK.

title

 public String getTitle()
 public void setTitle(java.lang.String title)
The title text of the font chooser dialog box, usually shown in the title bar.

value

 public Font getValue()
 public void setValue(java.awt.Font value)
The active font value. Typically, this value determines the font that is initially displayed when the dialog box appears.

visible

 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.

FontChooser methods

show()

  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.


FontChooser event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

action

 public void addActionListener(java.awt.event.ActionListener l)
 public void removeActionListener(java.awt.event.ActionListener l)