FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
Environment:
OS:windows8.1 pro (both 32bit and 64bit)
JRE:Java7u2(32bit) and later
A DESCRIPTION OF THE PROBLEM :
Description:
GraphicsEnvironment API does not detect dynamically attached graphics device
how to reproduce:
1. start application under JNLP
2. attach new graphics device
3. can't obtain "currently" attached���device through GraphicsEnvironemnt API
It works fine on jre6/jre7u2 or earlier.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
how to reproduce:
1. start application under JNLP
2. attach new graphics device
3. can't obtain "currently" attached���device through GraphicsEnvironemnt API
environment:
OS:windows8.1 pro (both 32bit and 64bit)
JRE:Java7u2(32bit) and later
It works fine on jre6/jre7u2 or earlier.
Test Source Code:
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class test {
private static void getgdi() {
GraphicsDevice[] devices = GraphicsEnvironment
.getLocalGraphicsEnvironment().getScreenDevices();
for (int i = 0; i < devices.length; i++) {
GraphicsDevice aGraphicsDevice = devices[i];
int intWidth = aGraphicsDevice.getDisplayMode().getWidth();
int intHeight = aGraphicsDevice.getDisplayMode().getHeight();
GraphicsConfiguration gc = aGraphicsDevice
.getDefaultConfiguration();
Point point = gc.getBounds().getLocation();
System.out
.printf("display: %d width %d height %d : posX %d posY %d \n",
i, intWidth, intHeight, point.x, point.y);
}
}
public static void main(String args[]) {
try {
while (true) {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String buf = br.readLine();
if (buf.equals("end"))
break;
getgdi();
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("get gdiinfo done");
}
}
REPRODUCIBILITY :
This bug can be reproduced always.