0
JNJPからの起動でgetScreenDevices().length()が正常な値を返さない
java7update2より後からjava8u25の現在の問題で、
GraphicsEnvironmentAPIを使用して、アプリ起動後にマル
チスクリーンの追加変更をする実装で、
getScreenDevices().length()を使用しても正確な情報を
取得することができません。(起動時のま
まの値)。
Jre6/java7Update2以前の環境では正常に動作していま
す。
環境
OS :windows8.1 pro 64bit or 32bit
JAVA: 32bit java8 Update25/Java7 update 67
再現性:常に発生
条件:ローカルでECLIPSEから実行するには問題なく動作
しますが、webstart(JNLP)で実行すると現在値が取得で
きません。
StringBuilder sb= new StringBuilder("");
GraphicsDevice[] devices =
GraphicsEnvironment.getLocalGraphicsEnvironment().ge
tScreenDevices();
sb.append("\n getScreenDevices().length =
"+devices.length);
if (devices.length >= 1) {
for (int i = 0; i < devices.length; i++) {
GraphicsDevice aGraphicsDevice =
devices[i];
String strID=
aGraphicsDevice.getIDstring();
int intWidth =
aGraphicsDevice.getDisplayMode().getWidth();
int intHeight =
aGraphicsDevice.getDisplayMode().getHeight();
sb.append("\n "+i+":"+strID+" :
Width= "+intWidth+ " Height= "+intHeight);
GraphicsConfiguration gc =
aGraphicsDevice.getDefaultConfiguration();
Point point =
gc.getBounds().getLocation();
sb.append(" point.x = "+point.x+ "
y= "+point.y);
System.out.printf("is_Online:
display %d width %d height %d bounds: posX %d posY
%d \n",
i,
intWidth,intHeight,point.x,point.y );
}
}
}