0

I have created ComboBox and CheckBox in a Form.
Now what I want to do is, if I checked that CheckBox means the ComboBox will be disabled. How to do that?

gnat
  • 6,213
  • 108
  • 53
  • 73
Juhi
  • 85
  • 7

1 Answers1

4

You should set disable the ComboBox when the CheckBox is checked. You must put this code inside the actionPerformed method, when you capture a FIRE key pressed for example. So:

  if(checkBox.isSelected()){
       comboBox.setEnabled(false);
    }else{
       comboBox.setEnabled(true);
    }
Mun0n
  • 4,438
  • 4
  • 28
  • 46