File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

button "Enter" key

 
Vijay Vaddem
Ranch Hand
Posts: 243
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a screen with couple of text fields and buttons.
once the user enters the values in the text fields,
"he moves on to the OK button using tab key" and presses Enter key.

Once he press the enter key, the actionListener method of OK button
should be invoked as if he clicked on that button.

Can anyone help pls...?

Vijay
 
sasi kala
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

in key listener use,it will call the actionPerformed method

All The Best
 
Mikie Williams
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you could also do
getRootPane().setDefaultButton(button1)
so that the user doesn't even have to tab to the ok button . He just has to hit enter.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic