8159906: [TEST_BUG] javax/swing/JDialog/Transparency/TransparencyTest.java
Reviewed-by: psadhukhan, yan
This commit is contained in:
parent
0bf2918064
commit
1ed59c02c8
@ -24,10 +24,12 @@
|
|||||||
/*
|
/*
|
||||||
@test
|
@test
|
||||||
@key headful
|
@key headful
|
||||||
@bug 8062946
|
@bug 8062946 8159906
|
||||||
@summary Verify Transparency upon iconify/deiconify sequence
|
@summary Verify Transparency upon iconify/deiconify sequence
|
||||||
@run main TransparencyTest
|
@run main TransparencyTest
|
||||||
*/
|
*/
|
||||||
|
import java.awt.GraphicsEnvironment;
|
||||||
|
import java.awt.GraphicsDevice;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Robot;
|
import java.awt.Robot;
|
||||||
@ -43,7 +45,7 @@ public class TransparencyTest {
|
|||||||
private static final int WIDTH = 250;
|
private static final int WIDTH = 250;
|
||||||
private static final int HEIGHT = 250;
|
private static final int HEIGHT = 250;
|
||||||
private static final float OPACITY = 0.60f;
|
private static final float OPACITY = 0.60f;
|
||||||
private static Point dlgPos;
|
private static volatile Point dlgPos;
|
||||||
|
|
||||||
public static void createAndShowGUI() {
|
public static void createAndShowGUI() {
|
||||||
frame = new JFrame("JFrame");
|
frame = new JFrame("JFrame");
|
||||||
@ -67,6 +69,14 @@ public class TransparencyTest {
|
|||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
|
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||||
|
GraphicsDevice gd = ge.getDefaultScreenDevice();
|
||||||
|
GraphicsDevice.WindowTranslucency mode = GraphicsDevice.WindowTranslucency.TRANSLUCENT;
|
||||||
|
boolean translucencyCheck = gd.isWindowTranslucencySupported(mode);
|
||||||
|
if(!translucencyCheck) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Robot robot = new Robot();
|
Robot robot = new Robot();
|
||||||
// create a GUI
|
// create a GUI
|
||||||
SwingUtilities.invokeAndWait(new Runnable() {
|
SwingUtilities.invokeAndWait(new Runnable() {
|
||||||
|
Loading…
Reference in New Issue
Block a user