• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

navigating JTextFields via up/down keys

 
Timothy Hoyle
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> 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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UI questions should be asked on the UI forum.
CarefullyChooseOneForum

Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic