Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting focus on JList  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JDialog with a Jlist on it. How can I ensure that focus is always on the JList when the
dialog opens? Sometimes who have to tab to it which is confusing to the users.
Thanks.
 
Cy Bird
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming you've tried requestFocus() or grabFocus()...
 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. I've tried both of those.
 
Cy Bird
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had similar type of problem. What fixed my problem was to do a setFocusable(false) for every other component that might of been messing with me.
(If you think this might be the problem, don't forget about scrollbars!)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!