java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
cmpt213.assignment4.packagedeliveries.client.view.util.customUI.RoundButton
All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class RoundButton extends JButton
Custom class that creates a Rounded JButton; inherits from JButton
See Also:
  • Constructor Details

    • RoundButton

      public RoundButton(String btnText, String label, ActionListener al, Color btnColor, Color btnColorDark, int height, Font font)
      Constructor for RoundButton, sets fields and certain JButton fields.
      Parameters:
      btnText - Text of Button
      label - ActionCommand of Button
      al - ActionListener that the button will add.
      btnColor - Normal colour of button.
      btnColorDark - Colour that will appear on button hover or selection.
      height - Height of the button.
      font - Font that button text uses.
  • Method Details

    • paintComponent

      protected void paintComponent(Graphics g)
      Paints the button to screen.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics object to protect