This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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!
 
wood burning stoves
 
subject: SET A BUTTON AS "DEFAULT"
 
Similar Threads
Controlling Enter Key-Triggered Submit Behavior
JDialog: How to set focus on second JButton?
ENTER must activate the default button when pressed on a JTable
EnterKey to switch panels
how to delete multiple browse