my dog learned polymorphism
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

navigating JTextFields via up/down keys

Timothy Hoyle

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...

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: 10745

UI questions should be asked on the UI forum.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Have you checked out Aspose?
subject: navigating JTextFields via up/down keys
It's not a secret anymore!