A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
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.
GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Press ENTER and ignit activate the button
coding for response to enter button on keyboard
Keypressing on console or Dos prompt
Sign in button
SET A BUTTON AS "DEFAULT"
KeyListener for a button?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014