< prev index next >

test/javax/swing/JPopupMenu/7156657/bug7156657.java

Print this page


   1 /*
   2  * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.sun.awt.AWTUtilities;
  25 import sun.awt.SunToolkit;
  26 
  27 import javax.swing.*;
  28 import java.awt.*;
  29 import java.awt.image.BufferedImage;
  30 import java.util.concurrent.Callable;
  31 
  32 /* @test
  33    @bug 7156657
  34    @summary Version 7 doesn't support translucent popup menus against a translucent window
  35    @library ../../regtesthelpers
  36    @author Pavel Porvatov


  37 */
  38 public class bug7156657 {
  39     private static JFrame lowerFrame;
  40 
  41     private static JFrame frame;
  42 
  43     private static JPopupMenu popupMenu;
  44 
  45     public static void main(String[] args) throws Exception {
  46         final Robot robot = new Robot();
  47         final SunToolkit toolkit = ((SunToolkit) Toolkit.getDefaultToolkit());
  48 
  49         Boolean skipTest = Util.invokeOnEDT(new Callable<Boolean>() {
  50             @Override
  51             public Boolean call() throws Exception {
  52                 frame = createFrame();
  53 
  54                 if (!AWTUtilities.isTranslucencyCapable(frame.getGraphicsConfiguration())) {
  55                     System.out.println("Translucency is not supported, the test skipped");
  56 


   1 /*
   2  * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import com.sun.awt.AWTUtilities;
  25 import sun.awt.SunToolkit;
  26 
  27 import javax.swing.*;
  28 import java.awt.*;
  29 import java.awt.image.BufferedImage;
  30 import java.util.concurrent.Callable;
  31 
  32 /* @test
  33    @bug 7156657
  34    @summary Version 7 doesn't support translucent popup menus against a translucent window
  35    @library ../../regtesthelpers
  36    @author Pavel Porvatov
  37    @modules java.desktop/com.sun.awt
  38             java.desktop/sun.awt
  39 */
  40 public class bug7156657 {
  41     private static JFrame lowerFrame;
  42 
  43     private static JFrame frame;
  44 
  45     private static JPopupMenu popupMenu;
  46 
  47     public static void main(String[] args) throws Exception {
  48         final Robot robot = new Robot();
  49         final SunToolkit toolkit = ((SunToolkit) Toolkit.getDefaultToolkit());
  50 
  51         Boolean skipTest = Util.invokeOnEDT(new Callable<Boolean>() {
  52             @Override
  53             public Boolean call() throws Exception {
  54                 frame = createFrame();
  55 
  56                 if (!AWTUtilities.isTranslucencyCapable(frame.getGraphicsConfiguration())) {
  57                     System.out.println("Translucency is not supported, the test skipped");
  58 


< prev index next >