Two Laptop Bag*
The moose likes Beginning Java and the fly likes SET A BUTTON AS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SET A BUTTON AS "DEFAULT"" Watch "SET A BUTTON AS "DEFAULT"" New topic
Author

SET A BUTTON AS "DEFAULT"

RAY CARNES
Greenhorn

Joined: May 02, 2000
Posts: 11
How do I make a button the "default" button - the one a user can click by pressing the Enter key?
Tom P
Ranch Hand

Joined: May 06, 2000
Posts: 88
You have to catch keystrokes and look for the enter key. When the enter key is pressed, trigger the button.
RAY CARNES
Greenhorn

Joined: May 02, 2000
Posts: 11
Many thanks!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SET A BUTTON AS "DEFAULT"