This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Tab Key Fire Action Listener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Tab Key Fire Action Listener" Watch "Tab Key Fire Action Listener" New topic
Author

Tab Key Fire Action Listener

Terry Tucker
Greenhorn

Joined: Jan 21, 2013
Posts: 18

Greetings:

I am a greenhorn!

I am working on a simple GUI application. I want the tab key to generate an actionPerformed() event for my ActionListener. Also, I want the Enter key to perform the same action as the Tab key; that is, move focus to the next field. In other words, I want these two keys to be synonymous is their behaviour. Can you point me to a good example of how to do that?

Thanks...
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 1946
    
  28
I suggest you look into key bindings
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tab Key Fire Action Listener
 
Similar Threads
How to use tab key and hot-keys in JFileChooser dialog?
Pressing a key from the code
Tab Controll
use of tab key in table
Tab Key Binding JTextField