I meet a stange question: First I have a nameCheckBox , a nameJTextField and a locationCheckBox , a locationJTextField and a JComboBox include two items 'and' , 'or' . Second I write a JTFieldFocusListener implements FocusListener and a CheckBoxListener implements ItemListener; Third I made : nameBox.addItemListener(myBListener); locationBox.addItemListener(myBListener); nameField.addFocusListener(myJTFocusListener); locationField.addFocusListener(myJTFocusListener); At last , when nameBox was selected , nameField was setEditable; when locationBox was selected , locationField was setEditable.
But When I run , I cann't set mouse to focus into nameField or loactionField once I change item of JComboBox. I only can put mouse out of the GUI and put into the GUI again , then I can put mouse into field again. Why ? can anyone help me ? Thanks very much! please quick!