-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
7
-
generic
-
windows
The following code below doesn't throw HeadlessException if executed with -Djava.awt.headless=true
Platform: Windows
JDK 7 b74 - FAILS
JDK 7 b73 - PASSES
though methods of class java.awt.GraphicsEnvironment
public abstract GraphicsDevice getDefaultScreenDevice()
public abstract GraphicsDevice[] getScreenDevices()
mention
* @exception HeadlessException if isHeadless() returns true
-----------------------------------------------------------------------------------
import java.awt.*;
public class TestGetDefScreenDevice {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
// the following methods must throw HeadlessException in headless mode
ge.getDefaultScreenDevice();
ge.getScreenDevices();
System.out.println("Failed. HeadlessException not thrown");
} catch (HeadlessException he) {
System.out.println("Passed. HeadlessException thrown as expected");
}
}
}
-----------------------------------------------------------------------------------
Platform: Windows
JDK 7 b74 - FAILS
JDK 7 b73 - PASSES
though methods of class java.awt.GraphicsEnvironment
public abstract GraphicsDevice getDefaultScreenDevice()
public abstract GraphicsDevice[] getScreenDevices()
mention
* @exception HeadlessException if isHeadless() returns true
-----------------------------------------------------------------------------------
import java.awt.*;
public class TestGetDefScreenDevice {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
// the following methods must throw HeadlessException in headless mode
ge.getDefaultScreenDevice();
ge.getScreenDevices();
System.out.println("Failed. HeadlessException not thrown");
} catch (HeadlessException he) {
System.out.println("Passed. HeadlessException thrown as expected");
}
}
}
-----------------------------------------------------------------------------------
- duplicates
-
JDK-6896335 GraphicsEnvironment.getDefaultScreenDevice() throws UnsatisfiedLinkError in headless mode
-
- Resolved
-