Class TextButton

All Implemented Interfaces:
Serializable, LayoutElement, Positionable

public final class TextButton extends AbstractButton
Represents a button that displays text.
See Also:
  • Constructor Details

    • TextButton

      public TextButton(int x, int y, @NotNull @NotNull Text message) throws IllegalArgumentException
      Constructs a new text button using the default dimesions.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      message - the text message
      Throws:
      IllegalArgumentException - if coordinates are negative, or message is null
    • TextButton

      public TextButton(@NotNull @NotNull ElementBounds bounds, @NotNull @NotNull Text message)
      Constructs a new text button.
      Parameters:
      bounds - the bounds to use
      message - the text message
    • TextButton

      public TextButton(int x, int y, int width, int height, @NotNull @NotNull Text message) throws IllegalArgumentException
      Constructs a new text button.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      width - the width
      height - the height
      message - the text message
      Throws:
      IllegalArgumentException - if coordinates or dimensions are negative, or message is null
    • TextButton

      public TextButton(int x, int y, int width, int height, @NotNull @NotNull String messageJSON) throws IllegalArgumentException
      Constructs a new text button.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      width - the width
      height - the height
      messageJSON - the text message in JSON format
      Throws:
      IllegalArgumentException - if coordinates or dimensions are negative, or message is null