|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.uifextras.util.UIFactory
public final class UIFactory
A factory class that consists only of static methods to create frequently used Swing components.
Method Summary | |
---|---|
static JLabel |
createBoldLabel(String text)
Creates and returns a JLabel with a bold font for the
specified text. |
static JLabel |
createBoldLabel(String text,
int sizeIncrement)
Creates and returns a JLabel with a bold font for the
specified text and size increment, e.g. +3 is 3 pixel larger than the
default. |
static JLabel |
createBoldLabel(String text,
int sizeIncrement,
Color foreground)
Creates and returns a JLabel with a bold font for the
specified text, size increment, and foreground color. |
static JLabel |
createBoldLabel(String text,
int sizeIncrement,
Color foreground,
boolean antiAliased)
Creates and returns a JLabel with a bold font for the
specified text, size increment, foreground color, and anti-alias
setting. |
static JEditorPane |
createHTMLPane(boolean asynchronousLoad,
boolean processEvents)
Creates and returns an editor pane that shall be used for displaying HTML pages. |
static JEditorPane |
createInfoEditorPane()
Creates and returns a non-editable JEditorPane with editable background. |
static JTextArea |
createInfoTextArea()
Creates and returns a non-editable JTextArea with editable background. |
static TableCellRenderer |
createLeftAlignedDefaultHeaderRenderer()
Creates and returns a left aligned table header renderer. |
static JTextArea |
createMultilineLabel(String text)
Creates and returns a JTextArea that can be used as a
label that spans over multiple lines. |
static JLabel |
createPlainLabel(String text)
Creates and returns a JLabel that uses a plain font. |
static JLabel |
createPlainLabel(String text,
Color foreground)
Creates and returns a JLabel that uses a plain font and
the given foreground color. |
static JLabel |
createPlainLabel(String text,
Color foreground,
boolean antiAliased)
Creates and returns a JLabel that uses a plain font and
the given foreground color. |
static JTextField |
createReadOnlyTextField()
Creates and returns a JTextField, that is read-only. |
static JScrollPane |
createStrippedScrollPane(Component component)
Creates and returns a JScrollPane that has an empty border. |
static JSplitPane |
createStrippedSplitPane(int orientation,
Component comp1,
Component comp2,
double resizeWeight)
Creates and returns a JSplitPane that has empty borders. |
static JComponent |
createTablePanel(JTable table)
Creates and returns a component that wraps a JTable with
a JScrollPane , sets the viewport's background and
appropriate corners. |
static JTextArea |
createWrappedMultilineLabel(String text)
Creates and returns a JTextArea that can be used as a
label that spans over multiple lines. |
static Color |
getLightBackground()
Returns a light background Color . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JLabel createBoldLabel(String text)
JLabel
with a bold font for the
specified text.
text
- the label's initial text
public static JLabel createBoldLabel(String text, int sizeIncrement)
JLabel
with a bold font for the
specified text and size increment, e.g. +3 is 3 pixel larger than the
default.
text
- the label's initial textsizeIncrement
- a pixel delta that is added to the default font size
public static JLabel createBoldLabel(String text, int sizeIncrement, Color foreground)
JLabel
with a bold font for the
specified text, size increment, and foreground color.
text
- the label's initial textsizeIncrement
- a pixel delta that is added to the default font sizeforeground
- the label's foreground color
public static JLabel createBoldLabel(String text, int sizeIncrement, Color foreground, boolean antiAliased)
JLabel
with a bold font for the
specified text, size increment, foreground color, and anti-alias
setting.
text
- the label's initial textsizeIncrement
- a pixel delta that is added to the default font sizeforeground
- the label's foreground colorantiAliased
- true to enable anti-aliasing
public static JLabel createPlainLabel(String text)
JLabel
that uses a plain font.
Should be used judiciously - overrides l&f settings.
text
- the label's initial text
public static JLabel createPlainLabel(String text, Color foreground)
JLabel
that uses a plain font and
the given foreground color.
Should be used judiciously - overrides l&f settings.
text
- the label's initial textforeground
- the label's foreground color
public static JLabel createPlainLabel(String text, Color foreground, boolean antiAliased)
JLabel
that uses a plain font and
the given foreground color.
Should be used judiciously - override l&f settings.
text
- the label's initial textforeground
- the label's foreground colorantiAliased
- true to enable anti-aliasing
public static JTextField createReadOnlyTextField()
TODO: move to BasicComponentFactory
public static JTextArea createMultilineLabel(String text)
JTextArea
that can be used as a
label that spans over multiple lines. Requires hand-wrapped text.
text
- the text component's initial text - requires newlines
createWrappedMultilineLabel(String)
public static JTextArea createWrappedMultilineLabel(String text)
JTextArea
that can be used as a
label that spans over multiple lines. Will wrap lines at words.
text
- the text component's initial text
createMultilineLabel(String)
public static JEditorPane createInfoEditorPane()
public static JTextArea createInfoTextArea()
public static JEditorPane createHTMLPane(boolean asynchronousLoad, boolean processEvents)
asynchronousLoad
- true to load asynchronously, false for synchronousprocessEvents
- true to process events
public static JComponent createTablePanel(JTable table)
JTable
with
a JScrollPane
, sets the viewport's background and
appropriate corners.
table
- the table to be wrapped
public static TableCellRenderer createLeftAlignedDefaultHeaderRenderer()
public static JSplitPane createStrippedSplitPane(int orientation, Component comp1, Component comp2, double resizeWeight)
JSplitPane
that has empty borders.
Useful to avoid duplicate decorations, for example if the split pane
is contained by other components that already provide a border.
orientation
- the split pane's orientation: horizontal or verticalcomp1
- the top/left componentcomp2
- the bottom/right componentresizeWeight
- indicates how to distribute extra space
public static JScrollPane createStrippedScrollPane(Component component)
JScrollPane
that has an empty border.
Useful to avoid duplicate decorations, for example if the scrollpane
is contained by other components that already provide a border.
component
- the component to wrap
public static Color getLightBackground()
Color
. Computes and answers a
Color
that has a minimum and maximum brightness and is
slightly darker than the specified Color
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |