Package io.github.jonestimd.swing
Class LabelBuilder
- java.lang.Object
-
- io.github.jonestimd.swing.LabelBuilder
-
public class LabelBuilder extends java.lang.ObjectA builder class for creating labels.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLabelBuilder.FactoryA factory class for building multiple labels using the sameResourceBundleand a common resource prefix.
-
Field Summary
Fields Modifier and Type Field Description static charNO_MNEMONICCharacter to use for a combined mnemonic and name when the label has no mnemonic.
-
Constructor Summary
Constructors Constructor Description LabelBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelBuilderbold()Make the label font bold.LabelBuilderforComponent(java.awt.Component component)javax.swing.JLabelget()LabelBuildermnemonic(char mnemonic)Set the label mnemonic.LabelBuildermnemonicAndName(java.lang.String mnemonicAndName)Set the label's mnemonic and text from a resource bundle value.LabelBuildername(java.lang.String text)Set the label text.
-
-
-
Field Detail
-
NO_MNEMONIC
public static final char NO_MNEMONIC
Character to use for a combined mnemonic and name when the label has no mnemonic.- See Also:
- Constant Field Values
-
-
Method Detail
-
mnemonicAndName
public LabelBuilder mnemonicAndName(java.lang.String mnemonicAndName)
Set the label's mnemonic and text from a resource bundle value. The first character of the value indicates the mnemonic and the rest of the string indicates the label text. If the value starts with'_'then the label will not have a mnemonic.
-
name
public LabelBuilder name(java.lang.String text)
Set the label text.
-
mnemonic
public LabelBuilder mnemonic(char mnemonic)
Set the label mnemonic.
-
forComponent
public LabelBuilder forComponent(java.awt.Component component)
- Parameters:
component- the component to be associated with the label
-
bold
public LabelBuilder bold()
Make the label font bold.
-
get
public javax.swing.JLabel get()
-
-