File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Keyboard usage of a JOptionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Keyboard usage of a JOptionPane" Watch "Keyboard usage of a JOptionPane" New topic

Keyboard usage of a JOptionPane

Andrew Collins
Ranch Hand

Joined: Mar 28, 2002
Posts: 42
Hi folks,
I have this JOptionPane placed on a Dialog :

When I press the tab button on this dialog the focus nicely switches between someTextField, button1 and button2.
Now here's my problem, even when button2 has the focus, it's allways button1 that gets "pressed" when I hit the return key.
Does anyone of you know how to solve this ?
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Andrew,
This is the wrong forum for this question. Try the SWING/JFC/AWT forum.
Michael Morris

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
I agree. Here's the link:
subject: Keyboard usage of a JOptionPane