File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes navigating JTextFields via up/down keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "navigating JTextFields via up/down keys" Watch "navigating JTextFields via up/down keys" New topic
Author

navigating JTextFields via up/down keys

Timothy Hoyle
Greenhorn

Joined: Oct 12, 2009
Posts: 18
So, once again I am pulling my hair out trying to figure this out. I have a budget GUI that enters expenses into a JTextField where it is compared against other values and calculated.

The point is though, I have an array of JTextFields which I can currently navigate via the tab shift/tab keys. However, I want to be able to also navigate the textFields in the array via the up/down arrow keys. Should I use keyListeners of KeyBindings and what is the difference?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Should I use keyListeners of KeyBindings...

neither,
include the down arrow key in the forward set of focusTraversal keys
include the up arrow key in the backward set of focusTraversal keys
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10247
    
    8

UI questions should be asked on the UI forum.
CarefullyChooseOneForum

Moving.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: navigating JTextFields via up/down keys