Ensuring OK/Cancel visible when using complex JOptionPane
Hi all,
I am using a quite complex JOptionPane, but unfortunately there are occassions when the OK/Cancel buttons are not shown because the information I am displaying means that the buttons 'fall off' the bottom of the OptionPane. This isn't an issue if the user knows that there should be OK/Cancel buttons and can drag the size of the pane larger to gain access to them, but a new user can be presented with an option pane with no buttons and no idea how to proceed.
What I am hoping is that there is a simple way to ensure that the OK/Cancel buttons are always visible, is this possible?
The method below creates my option pane, but at the time it is created the height of the parametersPanel may not be final.
Thanks in advance for any help...
private JOptionPane getJOptionPane() {
if (jOptionPane == null) {
JPanel main = parent.getMainPanel();
parent.remove(main);
main.add(getTopLabel(),BorderLayout.NORTH);
main.add(parametersPanel,BorderLayout.CENTER);
jOptionPane = new JOptionPane(main,JOptionPane.PLAIN_MESSAGE,JOptionPane.OK_CANCEL_OPTION);
jOptionPane.addPropertyChangeListener(this);
}
return jOptionPane;
}

