• Post Reply Bookmark Topic Watch Topic
  • New Topic

auto tab with JFormattedTextField  RSS feed

 
Marc Maréchal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have to implement auto tab with JFormattedTextField. When the maximum (to define) characters are entered in the JTextField, the focus should move automatically to the next component. I will use getNextFocusableComponent() and requestFocusOnWindow(), but I don't know the best way to know when the max characters are reached. Also, I will use a DocumentFilter and an InputFilter.
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried a KeyListener to count the keystrokes?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!