File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem of focus in JOptionPane" Watch "Problem of focus in JOptionPane" New topic

Problem of focus in JOptionPane

Mehdi Aboulkassim

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){

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:
subject: Problem of focus in JOptionPane
It's not a secret anymore!