Class GameButton

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

public class GameButton extends JButton
GameButton is button with set colors to make it match consistently across UI.
Author:
Molly
See Also:
  • Constructor Details

    • GameButton

      public GameButton(String name, Dimension dim, ActionListener action)
      Normal button.
      Parameters:
      name - Text on button
      dim - Size of button
      action - Action for button
    • GameButton

      public GameButton(String name, Dimension dim, ActionListener action, String filename)
      Button with image or icon.
      Parameters:
      name - button name
      dim - size of button
      action - action of button
      filename - filename for image
  • Method Details

    • changeIcon

      public void changeIcon(String filename)
      Change icon on button
      Parameters:
      filename - filename of new icon
    • changeActionListener

      public void changeActionListener(ActionListener actionListener)
      Changes action on button.
      Parameters:
      actionListener - new action listener
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent