wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Setting a request focus on a button. HELP! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Setting a request focus on a button. HELP!" Watch "Setting a request focus on a button. HELP!" New topic
Author

Setting a request focus on a button. HELP!

Ryan Schnautm
Greenhorn

Joined: Feb 19, 2003
Posts: 1
I built a small windows program.
I have an text field and a couple labels, a checkbox group and button, I instantiated the button in the middle of a flow layout. Now, i need to set the requestFocus(); to the button, which is name calculate.
Now what do i do to set that, so when i turn my program on, i just type my numbers in and hit enter. I need to have it set to either press enter or click the calculate button, and I can not get the request focus to work correctly.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Topic on making a button the default button for the screen so enter works.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting a request focus on a button. HELP!
 
Similar Threads
HTML window reference needed in APPLET
Pressing ENTER when Button is selected doesnt fire buttonActionPerformed...
Listening for enterkey with any component in focus
How to call the action when we press the enter button
2 buttons listening for the same key