JOptionPane on Full Screen
843806Aug 9 2009 — edited Aug 9 2009Greetings:
I'm sure that this is not a new issue around this forums; yet, I've not been able to find the precise answer (including goggling it); I came here to take a little bit of your time for a hint :)
My question is: how can I display a decorated JOptionPane in Fullscreen Mode? If I instantiate an OptionPane with the static contructor, it actually appears, but I just cannot make it look with decorations (so it looks quite unprofessional); if I give the parent frame with decorations, the Option pane is not shown correctly.
By the other hand, if I try to instatiate by myself, it just not appears. I thank you a lot in advanced for your help about this issue.
Regards.
--------------
Here it goes my code:
class Resolutions_ActionListener implements ActionListener {
private MainWin eventFrame;
private JComboBox comboBox;
private ScreenResolutions scrnResolutions;
public Resolutions_ActionListener (ScreenResolutions scrnResolutions, JComboBox comboBox, MainWin eventFrame) {
this.comboBox = comboBox;
this.eventFrame = eventFrame;
this.scrnResolutions = scrnResolutions;
} // end Resolutions_ActionListener() [constructor]
public void actionPerformed(ActionEvent event) {
int comboIndex = comboBox.getSelectedIndex();
JOptionPane newResolution_Dialog = new JOptionPane(" pane title", JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
if (scrnResolutions.scrnDevice.isDisplayChangeSupported() && eventFrame.FullScrnOn) {
scrnResolutions.scrnDevice.setDisplayMode(new DisplayMode(scrnResolutions.vector.get(comboIndex).width,
scrnResolutions.vector.get(comboIndex).height,
scrnResolutions.vector.get(comboIndex).bitDepth,
scrnResolutions.vector.get(comboIndex).refreshRate));
newResolution_Dialog.createDialog(eventFrame, " pane msj");
newResolution_Dialog.validate();
newResolution_Dialog.repaint();
newResolution_Dialog.updateUI();
newResolution_Dialog.setEnabled(true);
newResolution_Dialog.setVisible(true);
//none of these show it :(
}
else { comboBox.hidePopup();
JOptionPane.showMessageDialog(eventFrame, "resolution change only available at Full Screen.",
" pane title", JOptionPane.INFORMATION_MESSAGE);
//this pane is shown with but no decorations if on Full Screen Mode (as in Windowed mode works perfectly).
}
} // end actionPerformed()
} // end Resolutions_ActionListener.class