Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem of focus in JOptionPane

 
Mehdi Aboulkassim
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic