in j2se 1.4.1_02, a deadlock occurs about half the time on my machine. full screen mode will be set, and the display mode will change, but java will hang, and you’ll be left with a blank screen and a mouse cursor.
turns out there’s a potential java deadlock between the main thread and AWT-eventqueue thread when calling window.createBufferStrategy()
it occurs about half the time on my machine (windows xp, geforece4, latest video drivers) and didn’t occur in 1.4.1_01
i submitted a bug, but thought i’d post a workaround here. just synchronize with the window’s tree lock for the entire fullscreen/displaymode/bufferstrategy process:
synchronized (frame.[b]getTreeLock()[/b]) {
device.setFullScreenWindow(frame);
if (displayMode != null &&
device.isDisplayChangeSupported())
{
try {
device.setDisplayMode(displayMode);
}
catch (IllegalArgumentException ex) { }
}
frame.createBufferStrategy(2);
}