Hello there...
I need your help more. Now I have problem with JButton. I want the button listen for ENTER key. Logically, when I press ENTER key, it'll execute submit command. Can you help me solve this...
Thanx for all attentions...
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hello there...
I need your help more. Now I have problem with JButton. I want the button listen for ENTER key. Logically, when I press ENTER key, it'll execute submit command. Can you help me solve this...
Thanx for all attentions...
will focus be on the JButton? or will it b on a text box control? Because lets say for instance its a login screen then you want to listen to the Enter command on the password textarea to save people tabbing to the button, although you would want to listen for enter on the button also.
Maybe this will be a clue, http://www.javaprogrammingforums.com...ava-swing.html
Chris
r12ki (July 31st, 2009)
I mean on JButton only
Try this, r12ki:
this.getRootPane().setDefaultButton(btnOK);
Cheers,
Sean C.
PekinSOFT Systems