wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Problem of focus in JOptionPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem of focus in JOptionPane" Watch "Problem of focus in JOptionPane" New topic
Author

Problem of focus in JOptionPane

Mehdi Aboulkassim
Greenhorn

Joined: Nov 18, 2004
Posts: 1
Hye every one,

I have a application that uses a JOptionPane, and I`ve added mnemonics to some buttons.
The problem is that when a JOptionPane message appears, and after clicking in the Yes button, the mnemonics are like desabled (I think that the JOptionPane steals the focus).

I`ve tried the following:

int response = JOptionPane.showYesNoMessage(.....);

if(response == JOptionPane.OK_OPTION){
getFocusCycleRootAncestor().transferFocus();
}

It does work but I`m looking for a general solution because I`ve override the JOptionPane class and I use it in lots of other classes.

Thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem of focus in JOptionPane
 
Similar Threads
JOptionPane - Browser
JDialogBox
How do I get my applet to get focus?
mnemonics are not getting focus for the menubar
Focus problem