Class Textfield

java.lang.Object
com.groiss.gui.AbstractComponent
com.groiss.gui.component.Textfield
All Implemented Interfaces:
Component, Serializable, Cloneable
Direct Known Subclasses:
HiddenField, PasswordField

public class Textfield extends AbstractComponent
The Textfield component is used for a single line text entry fields.
See Also:
  • Constructor Details

    • Textfield

      public Textfield()
      Constructs a new empty Textfield component.
    • Textfield

      public Textfield(String name)
    • Textfield

      public Textfield(String name, int size)
    • Textfield

      public Textfield(String name, int size, boolean enabled)
    • Textfield

      public Textfield(String name, String value)
      Constructor with name and value.
      Parameters:
      name - the name and id of the field.
      value - the value of the field
    • Textfield

      public Textfield(String name, String value, String styleClass)
      Constructor with name and value.
      Parameters:
      name - the group where the field belongs to
      value - the value of the field
      styleClass - the name of a CSS class
    • Textfield

      public Textfield(String name, String value, int maxlength, int size)
      Constructor with name, value maxlength and size
      Parameters:
      name - the group where the text field belongs to
      value - the value of the text field
      maxlength - the maximum length of the content
      size - the size of the field
  • Method Details

    • setMaxlength

      public void setMaxlength(int length)
      sets the maximum length of the text in the textfield
      Parameters:
      length - - the maximum length
    • getMaxlength

      public int getMaxlength()
    • setSize

      public void setSize(int size)
      sets the size of the textfield
      Parameters:
      size - - the size of the input field
    • getSize

      public int getSize()
    • setValue

      public void setValue(String value)
      sets the initial displayed value of the field
      Parameters:
      value - - the value
    • getValue

      public String getValue()
    • setContent

      public void setContent(Object o)
      Set the value attribute.
      Specified by:
      setContent in interface Component
      Overrides:
      setContent in class AbstractComponent
      Parameters:
      o - any object where the string representation is used for rendering
    • getContent

      public Object getContent()
      Get the value.
      Specified by:
      getContent in interface Component
      Overrides:
      getContent in class AbstractComponent
      Returns:
      the value attribute