title: Opening JOptionPane with focus after JComboBox selection
body: <p>I am having a problem with a <code>JComboBox</code> and a <code>JOptionPane</code> dialog.
  The situation is this:</p>
  
  <ul>
  <li>It needs to run from a Dialog, not a Frame</li>
  <li>Before data is set no check needs to be done</li>
  <li>After data is set changes need to be validated</li>
  </ul>
  
  <p>I have a JComboBox with initial data in it and I have an <code>ActionListener</code> which, on selection, displays a <code>JOptionPane</code> dialog with a warning about revalidating.</p>
  
  <p>When a selection is made the dialog appears as normal but the <code>JComboBox</code> doesn't finish it's cycle and keeps the <code>JComboBox</code> open until the dialog is clicked and then you need to do a further click to choose an option (regardless whether the first click is on top of the button).</p>
  
  <pre><code> import javax.swing.JPanel;
   import java.awt.Frame;
   import java.awt.BorderLayout;
   import javax.swing.JDialog;
   import javax.swing.JComboBox;
   import javax.swing.JOptionPane;
   import javax.swing.UIManager;
   import javax.swing.UnsupportedLookAndFeelException;
  
   public class DialogFocus extends JDialog {
  
        private static final long serialVersionUID = 1L;
        private JPanel jContentPane = null;
        private JComboBox jComboBox = null;
  
        public static void main(String[] args) {
             new DialogFocus(null);
        }
  
        /**
         * @param owner
         */
        public DialogFocus(Frame owner) {
             super(owner);
             initialize();
             setLookAndFeel();
             this.setVisible(true);
        }
  
        public void setLookAndFeel() {
             try {
                  UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
             } catch (ClassNotFoundException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
             } catch (InstantiationException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
             } catch (IllegalAccessException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
             } catch (UnsupportedLookAndFeelException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
             }
        }
  
        /**
         * This method initializes this
         * 
         * @return void
         */
        private void initialize() {
             this.setSize(300, 200);
             this.setContentPane(getJContentPane());
        }
  
        /**
         * This method initializes jContentPane
         * 
         * @return javax.swing.JPanel
         */
        private JPanel getJContentPane() {
             if (jContentPane == null) {
                  jContentPane = new JPanel();
                  jContentPane.setLayout(new BorderLayout());
                  jContentPane.add(getJComboBox(), BorderLayout.CENTER);
             }
             return jContentPane;
        }
  
        /**
         * This method initializes jComboBox     
         *      
         * @return javax.swing.JComboBox     
         */
        private JComboBox getJComboBox() {
             if (jComboBox == null) {
                  String[] items = {"1", "2", "3", "4", "5"};
                  jComboBox = new JComboBox(items);
                  jComboBox.addActionListener(new java.awt.event.ActionListener() {
                       public void actionPerformed(java.awt.event.ActionEvent e) {
                            showDialog();
                       }
                  });
             }
             return jComboBox;
        }
  
        protected void showDialog() {
             JOptionPane.showMessageDialog(this, "Selection made");
        }
  
   }
  </code></pre>
  
  <p>The code I am using is quite complex so I have thrown together a basic example of code here. With the look and feel set it required 2 clicks to click on a valid option but without it it required a single click. (<em>Comment out <code>setLookAndFeel()</code> in  the constructor</em>).</p>
  
  <p>Does anyone have any ideas how to fix this to make sure it only requires 1 click regardless of the look and feel?</p>
  
  <p>Thanks in advance</p>