All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.FontChooser

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.FontChooser

public class FontChooser
extends JComponent
implements ItemListener, ChangeListener

Constructor Index

 o FontChooser()

Method Index

 o ask(JFrame, String, Font, ChangeListener)
Convenience method to prompt for a Font.
 o getSelectedFont()
 o itemStateChanged(ItemEvent)
Called when some component in this dialog changes value
 o setSelectedFont(Font)
 o setSelectedFont(String, int, int)
 o stateChanged(ChangeEvent)
 o toString()

Constructors

 o FontChooser
 public FontChooser()

Methods

 o ask
 public static Font ask(JFrame parent,
                        String title,
                        Font initial,
                        ChangeListener target)
Convenience method to prompt for a Font.

Parameters:
fparent - the parent frame for the dialog box. fparent may be null if a default parent has been established with StandardDialog
title - a title for the dialog box
initial - the initial font
target - the ChangeListener that will be informed if the OK or Apply buttons are hit.
Returns:
If target is null, the dialog box will be modal and the method will return the final result, or null if cancelled. Otherwise, the dialog box is non-modal, the method returns null immediatly, and the listener is informed when appropriate. The source of the change event will be a FontChooser.
See Also:
StandardDialog
 o stateChanged
 public void stateChanged(ChangeEvent e)
 o itemStateChanged
 public void itemStateChanged(ItemEvent e)
Called when some component in this dialog changes value

 o toString
 public String toString()
Overrides:
toString in class Component
 o getSelectedFont
 public Font getSelectedFont()
 o setSelectedFont
 public void setSelectedFont(Font c)
 o setSelectedFont
 public void setSelectedFont(String n,
                             int sy,
                             int sz)

All Packages  Class Hierarchy  This Package  Previous  Next  Index