code: public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == ItemEvent.DESELECTED) {
              // disable text entry
              m_customPIDField.setEditable(false);
          } else if (e.getStateChange() == ItemEvent.SELECTED) {
              // enable text entry
              m_customPIDField.setEditable(true);
          }
      }
docs: for the checkbox