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
-
FontChooser()
-
-
ask(JFrame, String, Font, ChangeListener)
- Convenience method to prompt for a Font.
-
getSelectedFont()
-
-
itemStateChanged(ItemEvent)
- Called when some component in this dialog changes value
-
setSelectedFont(Font)
-
-
setSelectedFont(String, int, int)
-
-
stateChanged(ChangeEvent)
-
-
toString()
-
FontChooser
public FontChooser()
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
stateChanged
public void stateChanged(ChangeEvent e)
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Called when some component in this dialog changes value
toString
public String toString()
- Overrides:
- toString in class Component
getSelectedFont
public Font getSelectedFont()
setSelectedFont
public void setSelectedFont(Font c)
setSelectedFont
public void setSelectedFont(String n,
int sy,
int sz)
All Packages Class Hierarchy This Package Previous Next Index