A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
Swing / AWT / SWT
Press ENTER and ignit activate the button
Joined: Sep 10, 2004
Apr 03, 2005 18:18:00
Say I have a text field (search) and a button ("Get It"). the user simply put info in the jtextfield and intuitively he presses ENTER to proceed. how do i do that?
I tried getIt.getRootPane().setDefaultButton(getIt); but i get a
I don't know how to get the root frame :-(
any idea how to solve it?
Joined: Jul 11, 2001
Apr 04, 2005 08:26:00
One way is to add an actionListener to your
and have it call the same method your
's actionListener calls.
I agree. Here's the link:
- it saves me about five hours per week
subject: Press ENTER and ignit activate the button
Sign in button
Keypressing on console or Dos prompt
coding for response to enter button on keyboard
KeyListener for a button?
SET A BUTTON AS "DEFAULT"
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013