Class MMButton

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

public class MMButton extends JButton
MMButton is an extension of JButton that overrides the constructors for JButton, albeit with the addition of the name of the button as the first value for all constructors, and adds two new constructors to create standardized JButtons with all the required information.

Note: All constructors contain the name of the JButton in question. This MUST be provided and means that they don't directly line up to the traditional JButton constructors.

See Also:
  • Constructor Details

    • MMButton

      public MMButton(String name)
      Creates a JButton with the provided name
      See Also:
    • MMButton

      public MMButton(String name, Icon icon)
      Creates a JButton with the provided name and icon
      See Also:
    • MMButton

      public MMButton(String name, ResourceBundle resources, String text)
      Creates a JButton with the provided text and name, localized using the provided resource bundle
      See Also:
    • MMButton

      public MMButton(String name, String text)
      Creates a JButton with the provided text and name
      See Also:
    • MMButton

      public MMButton(String name, Action action)
      Creates a JButton with the provided name and action
      See Also:
    • MMButton

      public MMButton(String name, ResourceBundle resources, String text, Icon icon)
      Creates a JButton with the provided text, name, and icon, localized using the provided resource bundle
      See Also:
    • MMButton

      public MMButton(String name, String text, Icon icon)
      creates a JButton with the provided text, name, and icon
      See Also:
    • MMButton

      public MMButton(String name, ResourceBundle resources, String text, ActionListener actionListener)
      Creates a JButton with the provided text, name, and action listener, localized using the provided resource bundle
      See Also:
    • MMButton

      public MMButton(String name, String text, ActionListener actionListener)
      This creates a JButton without any toolTipText.
      Parameters:
      name - the name of the button
      text - the localized text string
      actionListener - the ActionListener to assign to the button
    • MMButton

      public MMButton(String name, ResourceBundle resources, String text, @Nullable String toolTipText, ActionListener actionListener)
      Creates a JButton with the provided text, toolTipText, name, and action listener, localized using the provided resource bundle
      See Also:
    • MMButton

      public MMButton(String name, String text, @Nullable String toolTipText, ActionListener actionListener)
      This creates a standard JButton for use in MegaMek.
      Parameters:
      name - the name of the button
      text - the localized text string
      toolTipText - the localized toolTipText string, or null if there is no tool tip (not recommended)
      actionListener - the ActionListener to assign to the button