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?
Asked
Active
Viewed 786 times
1 Answers
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
-
1You need to accept his answer which is correct (see the check you should have next to the answer) – Shai Almog Feb 04 '12 at 10:18