*/
public void displayChanged() {
int scrn = getScreenImOn();
// get current GD
Win32GraphicsDevice oldDev = (Win32GraphicsDevice)winGraphicsConfig
.getDevice();
// get new GD
Win32GraphicsDevice newDev = (Win32GraphicsDevice)GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getScreenDevices()[scrn];
// Set winGraphicsConfig to the default GC for the monitor this Window
// is now mostly on.
winGraphicsConfig = (Win32GraphicsConfig)newDev
.getDefaultConfiguration();
// if on a different display, take off old GD and put on new GD
if (oldDev != newDev) {
oldDev.removeDisplayChangedListener(this);
newDev.addDisplayChangedListener(this);
}
super.displayChanged();
}