• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JTable, JTextField and focus

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a JTable with cells backed by JTextFields:



Now I want the user to be able to enter text in the focused/selected
textfield simply by tabbing to that cell.
How can I cause editing to commence immediately when the user navigates
to a cell with the keyboard?
I have already tried several solutions:
- Calling requestFocus() on prev.getNext() (see above, second for-loop)
- Calling requestFocusInWindow() on prev.getNext() with the result that the requestFocusInWindow-method returns false
- Calling transferFocus() had no effect
- Calling DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().focusNextComponent() had no effect either.

Can anybody help me?

Stefan
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic