• Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBox getting focus?  RSS feed

 
Sylvia Allen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to write a little app with several text fields and a JComboBox. When the user clicks File > New, the focus should go to the JComboBox, but I haven't been able to make that happen. I have tried using JComboBox.requestFocus() and I have tried JComboBox.requestFocusInWindow() but both ways nothing happens at all--the combo box does not get the focus, nothing changes. What should I be using for this? Any help appreciated.
- SA
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sylvia,
some years ago I had the same problem. I tried to get the EditorComponent of the JComboBox. Then you can set the focus to that component.
Hope this helps you
Rene
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!