Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jcombobox.getEditor().getItem() empty  RSS feed

 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When I type in the JCombobox its start responding only from the second character , means the following code will not run in the first character

if (!jcombobox.getEditor().getItem().equals("")) {
button.setEnabled(true);
}

Why this is happen ?

Thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like you have your keylistener code in keyPressed()

think about it

press a key what's in the combo's editor?
then keyTyped()
finally keyReleased()
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I understand now

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!