I have created a DialogUtil which shows numbers of JOptionPan in different situation. sometimes in my action class call to this method with null parameters as below.
You can set JOptionPane always on top by using this code:-
JFrame jf=new JFrame(); jf.setAlwaysOnTop(true); int response = JOptionPane.showConfirmDialog(jf,"Message", "Title", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);