Class ModernTheme.ModernButton

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

public static class ModernTheme.ModernButton extends JButton
Modern styled button with hover effects.
  • Constructor Details

    • ModernButton

      public ModernButton(String text, Color background, Color foreground)
      Parameters:
      background - fill colour; hover and pressed shades are derived from it
      foreground - label colour
  • Method Details

    • setHoverBackground

      public void setHoverBackground(Color color)
      Overrides the derived hover fill.
    • paintComponent

      protected void paintComponent(Graphics g)
      Paints the rounded fill (normal, hover, pressed or disabled), focus ring and label.
      Overrides:
      paintComponent in class JComponent