• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make a text field have cursor flushing

 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use swing to create a login winow, with simply user name and password fields, and a submit button.

I have added a feature which is to remember user name value. So if the same user comes to login again, he/she doesn't need type the name again. Normally when the login window is on, there is a cursor flushing in the user name field. But if I let program automatically fill user name, I want the cursor go to the password field. I tried pwField.setCursor(...), but this is only to set cursor appearance when the mouse is moved over the field, not moving the cursor to there when the window is created. Can someone show me how to let cursor start to appear in password directly, instead of manually jump from user name to password from the start?

Thanks.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out .
Moving to a more suitable forum.
 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!