Class LabeledTextfield

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class LabeledTextfield extends JPanel
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • LabeledTextfield

      public LabeledTextfield()
    • LabeledTextfield

      public LabeledTextfield(JLabel label, JTextField textField, String labelPostion)
      Parameters:
      label -
      textField -
      labelPostion - one of the BorderLayout [NORTH, EAST, SOUTH, WEST] constants
  • Method Details

    • main

      public static void main(String[] args)
    • getLabel

      public JLabel getLabel()
      Returns:
      the label
    • setLabel

      public void setLabel(JLabel label)
      Parameters:
      label - the label to set
    • setLabelText

      public void setLabelText(String text)
      Parameters:
      text - the text to set for the label
    • getTextField

      public JTextField getTextField()
      Returns:
      the textField
    • setTextField

      public void setTextField(JTextField textField)
      Parameters:
      textField - the textField to set
    • setLabelPosition

      public void setLabelPosition(String labelPostion)
      Parameters:
      labelPostion - one of the BorderLayout [NORTH, EAST, SOUTH, WEST] constants
      Throws:
      IllegalArgumentException
    • setText

      public void setText(String textFieldInput)
      Sets the text of this TextComponent to the specified text. If the text is null or empty, has the effect of simply deleting the old text. When text has been inserted, the resulting caret location is determined by the implementation of the caret class.

      Note that text is not a bound property, so no PropertyChangeEvent is fired when it changes. To listen for changes to the text, use DocumentListener.

      Parameters:
      textFieldInput - the new text to be set
    • getText

      public String getText()
      Returns the text contained in this TextComponent. If the underlying document is null, an empty string is returned. Note that text is not a bound property, so no PropertyChangeEvent is fired when it changes. To listen for changes to the text, use DocumentListener.
      Returns:
      the text, or empty string if the document is null
    • setToolTipText

      public void setToolTipText(String text)
      Overrides:
      setToolTipText in class JComponent