This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Consider Paul's rocket mass heater.
subject: Keyboard usage of a JOptionPane
Similar Threads
Show Dialog with TextArea & Buttons
keyboard usage of a JOptionPane
How to detect FocusLost on JPanel
Calling JDialog from JDialog - Urgent please...
Customise JOptionPane