|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.connectina.swing.fontchooser.JFontChooser
public class JFontChooser
Provides a pane of controls designed to allow a user to
select a Font
.
Font
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
SELECTION_MODEL_PROPERTY
The selection model property name. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JFontChooser()
Creates a FontChooser pane with an initial default Font (Sans Serif, Plain, 12). |
|
JFontChooser(Font initialFont)
Creates a FontChooser pane with the specified initial Font. |
|
JFontChooser(FontSelectionModel model)
Creates a FontChooser pane with the specified FontSelectionModel . |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener to the model. |
static JDialog |
createDialog(Window parent,
boolean modal,
JFontChooser chooserPane,
ActionListener okListener)
Creates and returns a new dialog containing the specified FontChooser pane along with "OK" and "Cancel"
buttons. |
Font |
getSelectedFont()
Gets the current Font value from the FontChooser. |
FontSelectionModel |
getSelectionModel()
Returns the data model that handles Font selections. |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model. |
void |
setSelectedFont(Font Font)
Sets the current Font of the FontChooser to the specified Font. |
void |
setSelectionModel(FontSelectionModel newModel)
Sets the model containing the selected Font. |
static Font |
showDialog(Window parent,
Font initialFont)
Shows a modal FontChooser dialog and blocks until the dialog is hidden. |
static Font |
showDialog(Window parent,
JFontChooser fontChooser,
Font initialFont)
Shows a modal FontChooser dialog and blocks until the dialog is hidden. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String SELECTION_MODEL_PROPERTY
Constructor Detail |
---|
public JFontChooser()
public JFontChooser(Font initialFont)
initialFont
- the initial Font set in the chooserpublic JFontChooser(FontSelectionModel model)
FontSelectionModel
.
model
- the FontSelectionModel
to be usedMethod Detail |
---|
public Font getSelectedFont()
public void setSelectedFont(Font Font)
FontSelectionModel
will fire a ChangeEvent
Font
- the Font to be set in the Font chooserContainer.addPropertyChangeListener(java.beans.PropertyChangeListener)
public FontSelectionModel getSelectionModel()
FontSelectionModel
objectpublic void setSelectionModel(FontSelectionModel newModel)
newModel
- the new FontSelectionModel
objectpublic static Font showDialog(Window parent, Font initialFont) throws HeadlessException
null
.
parent
- the parent JFrame
for the dialoginitialFont
- the initial Font set when the FontChooser is shown
null
if the user opted out
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true.GraphicsEnvironment.isHeadless()
public static Font showDialog(Window parent, JFontChooser fontChooser, Font initialFont) throws HeadlessException
null
.
parent
- the parent JFrame
for the dialogfontChooser
- the FontChooser to be use in this dialoginitialFont
- the initial Font set when the FontChooser is shown
null
if the user opted out
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true.GraphicsEnvironment.isHeadless()
public static JDialog createDialog(Window parent, boolean modal, JFontChooser chooserPane, ActionListener okListener) throws HeadlessException
FontChooser
pane along with "OK" and "Cancel"
buttons. If the "OK" or "Cancel" buttons are pressed, the dialog is
automatically hidden (but not disposed).
parent
- the parent component for the dialogmodal
- a boolean. When true, the remainder of the program
is inactive until the dialog is closed.chooserPane
- the Font-chooser to be placed inside the dialogokListener
- the ActionListener invoked when "OK" is pressed
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true.GraphicsEnvironment.isHeadless()
public void addChangeListener(ChangeListener l)
ChangeListener
to the model.
l
- the ChangeListener
to be addedpublic void removeChangeListener(ChangeListener l)
ChangeListener
from the model.
l
- the ChangeListener
to be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |