I'm currently testing my URLyBird assignment on a SUN Solaris 10 box for the first time and have an obscure problem with my JOptionPane.
The user is presented a JOptionPane to input the customerID value. My JOptionPane can be also invoked from the keyboard, so the invoking button has an appropriate MNEMONIC_KEY defined.
But this works only for he first time! The second time I have to give focus to the applicction in order to have the mnemonic work as expected. Here are the problematic code snippets. Alas, everything works correct under Windows. OnSolaris it only works when I let set focus to the main window which is the owner JOptionPane.
Does anyone have a clue why it is not working as expected or how to proceed?
Indeed, my post might be unclear, so I'm trying to make myself a little clearer.
I'm opening a JOptionPane-based input dialog from within my actionPerformed method of my button's action class. The button's action can be invoked from the keyboard successfully only one time. The second time I type the mnemonic, nothing happens. It should, again, display the JOptionPane, right?
I wonder if some other component has the focus, because when I insert the call the have the mainwindow request the focus, I can successfully display the JOptionPane multiple times by typing the mnemonic. And I wonder why this happens only under Solaris and works ok in Windows.
Once you enter customer ID in the JOptionPane and click OK the focus should be at the main window with the table updated and all right? If that's the case, as long you are in the main window then you have the focus to trigger any actions.
If this is not the case, you should regroup your actions. If it is then its your action problem. Maybe posting your code where the book action is trigger and the actionPerformed of the book action may help.