A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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
It is sorta covered in the
JavaRanch Style Guide
subject: Press ENTER and ignit activate the button
SET A BUTTON AS "DEFAULT"
Keypressing on console or Dos prompt
coding for response to enter button on keyboard
KeyListener for a button?
Sign in button
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014