This is how i am setting a JFrame to full screen mode :
//set full screen
frame.dispose();
frame.setUndecorated(true);
screenDevice.setFullScreenWindow(frame);
frame.setVisible(true);
//reset to window mode
frame.dispose();
screenDevice.setFullScreenWindow(null);
frame.setUndecorated(false);
frame.setVisible(true);
But, when i display any dialog, something like settings dialog, the dialog and full screen frame both lost their foucs and disappear on screen. Then i need to click in the taskbar icon to get the focus.
How to solve this issue ? Thank you.
Edit:
Suppose if there is a JMenuItem in the menu bar of this full screen window, then i am making visible a settings JDialog by clicking the menuitem like this:
settingsMenuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
settingsDialog.showSettingsDialog();
}
});
The settingsDialog and full screen are not showing on the screen in full screen mode. in window mode it works normally.