Interface LabelBuilder<T>

Type Parameters:
T - the type to display in the label (using value.toString() or "" for null).
All Superinterfaces:
ComponentBuilder<T,JLabel,LabelBuilder<T>>

public interface LabelBuilder<T> extends ComponentBuilder<T,JLabel,LabelBuilder<T>>
A builder for JLabel.
  • Field Details

    • HORIZONTAL_ALIGNMENT

      static final PropertyValue<Integer> HORIZONTAL_ALIGNMENT
      Specifies the default horizontal alignment used in labels
      Value type: Integer (SwingConstants.LEFT, SwingConstants.RIGHT, SwingConstants.CENTER)
      Default value: SwingConstants.LEADING
  • Method Details

    • horizontalAlignment

      LabelBuilder<T> horizontalAlignment(int horizontalAlignment)
      Parameters:
      horizontalAlignment - the horizontal text alignment
      Returns:
      this builder instance
      See Also:
    • displayedMnemonic

      LabelBuilder<T> displayedMnemonic(int displayedMnemonic)
      Parameters:
      displayedMnemonic - the label mnemonic key code
      Returns:
      this builder instance
      See Also:
    • displayedMnemonic

      LabelBuilder<T> displayedMnemonic(char displayedMnemonic)
      Parameters:
      displayedMnemonic - the label mnemonic character
      Returns:
      this builder instance
      See Also:
    • labelFor

      LabelBuilder<T> labelFor(JComponent component)
      Parameters:
      component - the component to associate with this label
      Returns:
      this builder instance
      See Also:
    • icon

      LabelBuilder<T> icon(Icon icon)
      Parameters:
      icon - the label icon
      Returns:
      this builder instance
      See Also:
    • iconTextGap

      LabelBuilder<T> iconTextGap(int iconTextGap)
      Parameters:
      iconTextGap - the icon text gap
      Returns:
      this builder instance
      See Also:
    • builder

      static <T> LabelBuilder<T> builder(Icon icon)
      Type Parameters:
      T - the type to display in the label (using value.toString() or "" for null).
      Parameters:
      icon - the icon
      Returns:
      a new builder
    • builder

      static <T> LabelBuilder<T> builder(String text)
      Type Parameters:
      T - the type to display in the label (using value.toString() or "" for null).
      Parameters:
      text - the label text
      Returns:
      a new builder
    • builder

      static <T> LabelBuilder<T> builder(ValueObserver<T> linkedValueObserver)
      Type Parameters:
      T - the type to display in the label (using value.toString() or "" for null).
      Parameters:
      linkedValueObserver - the value observer to link to the label text
      Returns:
      a new builder