Class ModernTheme.ModernTextField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Enclosing class:
ModernTheme

public static class ModernTheme.ModernTextField extends JTextField
Modern text field with placeholder support.
  • Constructor Details

    • ModernTextField

      public ModernTextField()
      Themed field whose border switches to ModernTheme.BORDER_FOCUS while focused.
  • Method Details

    • setPlaceholder

      public void setPlaceholder(String placeholder)
      Hint text drawn while the field is empty; null clears it.
    • paintComponent

      protected void paintComponent(Graphics g)
      Paints the field, then the placeholder while it is empty.
      Overrides:
      paintComponent in class JComponent