Class JTextFieldPlaceholder

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Direct Known Subclasses:
JTextFieldWithIcon

public class JTextFieldPlaceholder extends JTextField
Textfield with information text displayed when empty.
See Also:
  • Constructor Details

    • JTextFieldPlaceholder

      public JTextFieldPlaceholder(String placeholder, String value)
      Create a textfield with hint and default value.
      Parameters:
      placeholder - Text displayed when empty
      value - Default value
    • JTextFieldPlaceholder

      public JTextFieldPlaceholder(String placeholder)
      Create a textfield with hint.
      Parameters:
      placeholder - Text displayed when empty
  • Method Details

    • paint

      public void paint(Graphics g)
      Overrides:
      paint in class JComponent
    • setPlaceholderText

      public void setPlaceholderText(String placeholderText)