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.
public static void showNotExist(JPanel panel, String action) { JOptionPane.showMessageDialog(rootPane, new JLabel(action.concat(" doesn't exist."), 2)); }
Try giving the rootpane as the 1st value in the showMessageDialog section