This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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