Link to home
Start Free TrialLog in
Avatar of pleasure
pleasure

asked on

How to hit a button using Enter instead of space bar?

hi experts,
Normally we hit a button by click on it using mouse, besides we can also press space bar when the focus is on the button to hit the button.
What i want to ask is.. can i allow my user to use Enter to hit the button instead of using space bar??

thanks
Avatar of Ovi
Ovi

yes, you can, just wait a little
Avatar of pleasure

ASKER

thanks a lot Ovi...muaaakkkkkkkkkkkkksssssssssssssssssss....:D
ASKER CERTIFIED SOLUTION
Avatar of Ovi
Ovi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi Ovi,
thanks for the response.. i will look into the code and get back to you later...thanks again...
ok, is working anyway ...
Avatar of CEHJ
Or

frame.getRootPane().setDefaultButton(someButton);
yes..it's work..thanks Ovi...
I'm glad to hear that.