Both ItemListener
as well as ActionListener
, in case of JCheckBox
have the same behaviour.
However, major difference is ItemListener
can be triggered by calling the setSelected(true)
on the checkbox.
As a coding practice do not register both ItemListener
as well as ActionListener
with the JCheckBox
, in order to avoid inconsistency.