• Post Reply Bookmark Topic Watch Topic
  • New Topic

default field in Dialog

 
Dylan Margoczi
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need to make my second field in a joption pane my default field to enter text while still being able to press the enter key for the ok button, is there any way of doing this?

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add a KeyListener to your second Field.
 
Dylan Margoczi
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see in what way this will help.

I basically want to have focus on it as it's a password field, and not have to tab through the fields as i should not need to change the values in the other fields. then just press the enter key to continue.
 
Brian Cole
Author
Ranch Hand
Posts: 920
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dylan Margoczi:
I need to make my second field in a joption pane my default field to enter text while still being able to press the enter key for the ok button, is there any way of doing this?


We discussed this here just last week.
 
Dylan Margoczi
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that.

I sorted out the problem by just creating my own custom dialog.
but thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!