Modal Dialog doesn't appear when owning JFrame is Full Screen Window
843805May 21 2006 — edited May 22 2006Hi - I have a problem opening a modal JDialog inside of a JFrame that has been set as the Full Screen Window. The dialog appears for a second, then disappears. I've searched the Internet about this, and could not find anything about this problem save one unanswered forum post in some obscure forum about the same problem.
It started when working on a game, and in that case the dialog actually appeared but if I minimized through Alt+Tab and then went back to it, it disappeared.
I reproduced the problem in two simple classes, shown below:
public class TestFrame extends JFrame
{
public TestFrame()
{
setUndecorated(true);
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(this);
JDialog testDialog = new TestDialog(this);
}
}
class TestDialog extends JDialog
{
public TestDialog(JFrame owner)
{
super(owner, true);
setLocation(300, 300);
setSize(400, 400);
setVisible(true);
}
}
When I construct TestFrame, I should see the dialog, but it flashes briefly and disappears. This only happens for modal dialogs.
I am using jdk 1.5.0_06 and Windows XP.
Any help would be greatly appreciated. Thanks!