posted 22 years ago
Since you're using a button you could use the setDefaultButton() method of JRootPane...
Here's a short example program showing how to use setDefaultButton() :
If you need to request focus for another kind of component, you may need to do so in a ComponentListener's componentShown() method attached to the dialog.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.