Class Button

All Implemented Interfaces:
IFigure
Direct Known Subclasses:
ArrowButton

public class Button extends Clickable
A Button usually has a border and appears to move up and down in response to being pressed. It can contain an image and/or text in it.
  • Constructor Details

    • Button

      public Button()
      Constructs a default Button with no icon or text.
      Since:
      2.0
    • Button

      public Button(Image image)
      Contructs a Button containing the icon image.
      Parameters:
      image - Image to be used by the Button as its icon.
      Since:
      2.0
    • Button

      public Button(String text)
      Constructs a Button containing the given text.
      Parameters:
      text - Text for the button.
      Since:
      2.0
    • Button

      public Button(String text, Image image)
      Constructs a Button with the given image and text.
      Parameters:
      text - Text for the button.
      image - Image for the button.
      Since:
      2.0
  • Method Details

    • init

      protected void init()
      Initializes this button by setting its default border and setting its background color to ColorConstants.button.
      Overrides:
      init in class Clickable
      Since:
      2.0