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

setNextFocusableComponent()  RSS feed

 
Craig Parsons
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My goal is to tab between 3 JTextArea's. If I use CTL / TAB it works but I only want to use the TAB key. I started to use setNextFocusableComponent() only to find out that it has been deprecated.
FocusTraversalPolicy has replace setNextFocusableComponent.
I am trying the following code. Everything compiles but the TAB isn't working.

Any ideas?
Thanks,
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default JTextArea uses Ctrl-Tab to traverse focus and inserts a '\t' for an actual Tab keypress.

Java Almanac has an article that shows you how to change this.
 
Craig Parsons
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to override the default process?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes... and the link I gave to Java Almanac earlier shows how...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!