JDK-8061637 : GraphicsEnvironment API does not detect dynamically attached graphics device
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u51,7u25,8,9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2014-10-19
  • Updated: 2018-11-17
  • Resolved: 2018-11-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12Resolved
Related Reports
Duplicate :  
Description
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.


Comments
not a regression for 9
19-10-2016

not a regression for 9 since introduced even in 8
04-04-2016

Reproduced from FCS
03-11-2015

Maksim K, please find out in what JDK 8 release the issue was introduced.
02-11-2015

> It works fine on jre6/jre7u2 or earlier. Is it reproducible on 8 GA?
22-10-2014

Pending Dev consideration. Possible regression.
21-10-2014