Class JCheckBoxMenuItem

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

public class JCheckBoxMenuItem extends JMenuItem
Emulator for JCheckBoxMenuItem. R_leaf_peer_lockdown-locked.
See Also:
  • Constructor Details

    • JCheckBoxMenuItem

      public JCheckBoxMenuItem()
    • JCheckBoxMenuItem

      public JCheckBoxMenuItem(String text)
    • JCheckBoxMenuItem

      public JCheckBoxMenuItem(Icon icon)
    • JCheckBoxMenuItem

      public JCheckBoxMenuItem(String text, Icon icon)
    • JCheckBoxMenuItem

      public JCheckBoxMenuItem(String text, boolean b)
    • JCheckBoxMenuItem

      public JCheckBoxMenuItem(String text, Icon icon, boolean b)
    • JCheckBoxMenuItem

      public JCheckBoxMenuItem(Action a)
  • Method Details

    • getState

      public boolean getState()
    • setState

      public void setState(boolean state)
    • isSelected

      public boolean isSelected()
      Overrides:
      isSelected in class AbstractButton
    • setSelected

      public void setSelected(boolean b)
      Description copied from class: AbstractButton
      Flips the selection flag and, on an actual change, fires ItemEvent then ChangeEvent — the fan-out DefaultButtonModel.setSelected performs.

      A plain JButton has no visual selected state, but it very much has the selection state: new JButton("go").setSelected(true) then isSelected() answers true on JDK 25, with an ItemEvent and a ChangeEvent delivered on the way. Only the rendering is missing here, which is the half R_decline_effect_only permits dropping. JToggleButton overrides this to coordinate its ButtonGroup and its surrogate's model (D_jradiobutton).

      Overrides:
      setSelected in class AbstractButton
    • getUIClassID

      public String getUIClassID()
      Overrides:
      getUIClassID in class JMenuItem