java.lang.Object
cmpt213.assignment4.packagedeliveries.client.view.util.customUI.CheckBoxUI
All Implemented Interfaces:
Icon

public class CheckBoxUI extends Object implements Icon
Custom CheckBox UI that a JComboBox will use. Makes the empty Box a rounded gray and the filled box a green box with a white check mark.
  • Constructor Details

    • CheckBoxUI

      public CheckBoxUI()
  • Method Details

    • paintIcon

      public void paintIcon(Component component, Graphics g, int x, int y)
      Paints icon correctly to screen.
      Specified by:
      paintIcon in interface Icon
      Parameters:
      component - a Component to get properties useful for painting
      g - the graphics context
      x - the X coordinate of the icon's top-left corner
      y - the Y coordinate of the icon's top-left corner
    • getIconWidth

      public int getIconWidth()
      Sets icon's new width. Change return value to resize icon. Used in updateSizes()
      Specified by:
      getIconWidth in interface Icon
      Returns:
      An integer that represents the preferred width of the icon.
    • getIconHeight

      public int getIconHeight()
      Sets icon's new height. Change return value to resize icon. Used in updateSizes()
      Specified by:
      getIconHeight in interface Icon
      Returns:
      An integer that represents the preferred height of the icon.