Interface TextFieldBuilder<T,C extends JTextField,B extends TextFieldBuilder<T,C,B>>

Type Parameters:
T - the type the text field represents
C - the text field type
B - the builder type
All Superinterfaces:
ComponentBuilder<T,C,B>, TextComponentBuilder<T,C,B>
All Known Subinterfaces:
NumberField.Builder<T>, PasswordFieldBuilder, TemporalField.Builder<T>

public interface TextFieldBuilder<T,C extends JTextField,B extends TextFieldBuilder<T,C,B>> extends TextComponentBuilder<T,C,B>
Builds a JTextField.
  • Method Details

    • columns

      B columns(int columns)
      Parameters:
      columns - the number of colums in the text component
      Returns:
      this builder instance
      See Also:
    • action

      B action(Action action)
      Parameters:
      action - the action to associate with the text field
      Returns:
      this builder instance
      See Also:
    • actionListener

      B actionListener(ActionListener actionListener)
      Parameters:
      actionListener - the action listener
      Returns:
      this builder instance
      See Also:
    • selector

      Adds a CTRL-SPACE action the given text field allowing the user to select a value to display in the field
      Parameters:
      selector - the selector providing the values to select from
      Returns:
      this builder instance
    • format

      B format(Format format)
      Associates the given format with the text field. Note that the format instance is cloned on build, so format instances can be reused when calling this method.
      Parameters:
      format - the format
      Returns:
      this builder instance
    • horizontalAlignment

      B horizontalAlignment(int horizontalAlignment)
      Parameters:
      horizontalAlignment - the horizontal text alignment
      Returns:
      this builder instance
      See Also:
    • hintText

      B hintText(String hintText)
      Parameters:
      hintText - the hint text to display when the field is empty and unfocused
      Returns:
      this builder instance
    • builder

      static <T, C extends JTextField, B extends TextFieldBuilder<T, C, B>> TextFieldBuilder<T,C,B> builder(Class<T> valueClass)
      Type Parameters:
      T - the value type
      C - the text field type
      B - the builder type
      Parameters:
      valueClass - the value class
      Returns:
      a builder for a component
    • builder

      static <T, C extends JTextField, B extends TextFieldBuilder<T, C, B>> TextFieldBuilder<T,C,B> builder(Class<T> valueClass, Value<T> linkedValue)
      Type Parameters:
      T - the value type
      C - the text field type
      B - the builder type
      Parameters:
      valueClass - the value class
      linkedValue - the value to link to the component
      Returns:
      a builder for a component