aspose file tools*
The moose likes Beginning Java and the fly likes coding for response to enter button on keyboard Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "coding for response to enter button on keyboard" Watch "coding for response to enter button on keyboard" New topic
Author

coding for response to enter button on keyboard

Alex Rugav
Greenhorn

Joined: May 03, 2006
Posts: 19
for example, a log on screen, how do you make the logon button respond to the enter button on the keyboard?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

In what context? Swing or a web page?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
I have on my mindreader's turban today (with the big ruby on it) and I'm picking up cosmic vibrations that you are using Swing:

yourFrame.getRootPane().setDefaultButton(yourButton);


There is no emoticon for what I am feeling!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: coding for response to enter button on keyboard
 
Similar Threads
Enable ENTER button in swing application
help me with the installation process
Cleaning keyboards
hitting the enter on the keyBoard should default to "YES" button on the html/jsp page
How to set Default button in Swing