File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Murach's Java Servlets and JSP this week in the Servlets 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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: coding for response to enter button on keyboard
 
Similar Threads
How to set Default button in Swing
Cleaning keyboards
Enable ENTER button in swing application
hitting the enter on the keyBoard should default to "YES" button on the html/jsp page
help me with the installation process