Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NX: a strange question about itemevent  RSS feed

steven Gu
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :
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!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!