Class TristateCheckBox

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

public class TristateCheckBox extends JCheckBox
A checkbox with checked, unchecked and part-checked states
Author:
Dr. Heinz M. Kabutz see http://www.javaspecialists.co.za/archive/Issue082.html
See Also:
  • Field Details

  • Constructor Details

    • TristateCheckBox

      public TristateCheckBox(String text, Icon icon, TristateCheckBox.State initial)
      Constructor TristateCheckBox
      Parameters:
      text -
      icon -
      initial -
    • TristateCheckBox

      public TristateCheckBox(String text, TristateCheckBox.State initial)
      Constructor TristateCheckBox
      Parameters:
      text -
      initial -
    • TristateCheckBox

      public TristateCheckBox(String text)
      Constructor TristateCheckBox
      Parameters:
      text -
    • TristateCheckBox

      public TristateCheckBox()
      Constructor TristateCheckBox
  • Method Details

    • addMouseListener

      public void addMouseListener(MouseListener l)
      No one may add mouse listeners, not even Swing!
      Overrides:
      addMouseListener in class Component
    • setState

      public void setState(TristateCheckBox.State state)
      Set the new state to either SELECTED, NOT_SELECTED or PART_SELECTED. If state == null, it is treated as PART_SELECTED.
    • getState

      public TristateCheckBox.State getState()
      Return the current state, which is determined by the selection status of the model.
    • setSelected

      public void setSelected(boolean b)
      Overrides:
      setSelected in class AbstractButton