Class GhostButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class GhostButton extends JButton
The GhostButton class is a button that displays a "ghostly" looking version of a standard button icon for use in full screen mode toolbar menus. The icon is modified so that it appears in grayscale and inverted.
Since:
3.2.2
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • GhostButton

      public GhostButton(String text, Icon icon)
      Creates a new button using an icon and text.
      Parameters:
      text - the button text label.
      icon - the button icon.
  • Method Details

    • getGhostIcons

      public static Icon[] getGhostIcons(Icon icon)
      Creates a ghostly looking version of an icon.
      Parameters:
      icon - the original icon to use as a source.
      Returns:
      the ghostly looking icons derived from the source as [normal, highlighted].
    • getMinimumSize

      public Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • getMaximumSize

      public Dimension getMaximumSize()
      Overrides:
      getMaximumSize in class JComponent
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • main

      public static void main(String[] argv)
      Tests this class.
      Parameters:
      argv - the array of command line parameters.