Class ModernTheme.StyledToggleButton

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

public static class ModernTheme.StyledToggleButton extends JToggleButton
Toggle button that paints background + text in one pass (no super.paintComponent) to avoid glitch.
  • Constructor Details

    • StyledToggleButton

      public StyledToggleButton()
      Bold, hand-cursor toggle; set its background and foreground for each state.
  • Method Details

    • paintComponent

      protected void paintComponent(Graphics g)
      Paints background and text in one pass to avoid the double-paint glitch.
      Overrides:
      paintComponent in class JComponent