Class LabelBuilder


  • public class LabelBuilder
    extends java.lang.Object
    A builder class for creating labels.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LabelBuilder.Factory
      A factory class for building multiple labels using the same ResourceBundle and a common resource prefix.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static char NO_MNEMONIC
      Character to use for a combined mnemonic and name when the label has no mnemonic.
    • Constructor Summary

      Constructors 
      Constructor Description
      LabelBuilder()  
    • 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
    • Constructor Detail

      • LabelBuilder

        public LabelBuilder()
    • 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()