< prev index next >

test/jdk/java/awt/Dialog/SiblingChildOrder/SiblingChildOrderTest.java

Print this page
rev 47956 : 8191678: [TESTBUG] Add keyword headful in java/awt and javax tests.
Summary: Also fix some NPE thrown if run headless.


   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 /* @test

  25  * @bug 8190230
  26  * @summary [macosx] Order of overlapping of modal dialogs is wrong

  27  * @run main SiblingChildOrderTest
  28  */
  29 
  30 import javax.swing.*;
  31 import java.awt.*;
  32 
  33 public class SiblingChildOrderTest
  34 
  35 {
  36     static Color[] colors = new Color[]{Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW};
  37     static int[] x = new int[]{200, 150, 100, 50};
  38     static int[] y = new int[]{200, 150, 100, 50};
  39     static JDialog[] dlgs = new JDialog[4];
  40     private static JFrame frame;
  41 
  42     public static void main(String args[]) throws Exception {
  43         SwingUtilities.invokeAndWait(() -> {
  44             frame = new JFrame("FRAME");
  45             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  46             frame.setBounds(50, 50, 400, 400);




   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 /**
  25  * @test
  26  * @bug 8190230
  27  * @summary [macosx] Order of overlapping of modal dialogs is wrong
  28  * @key headful
  29  * @run main SiblingChildOrderTest
  30  */
  31 
  32 import javax.swing.*;
  33 import java.awt.*;
  34 
  35 public class SiblingChildOrderTest
  36 
  37 {
  38     static Color[] colors = new Color[]{Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW};
  39     static int[] x = new int[]{200, 150, 100, 50};
  40     static int[] y = new int[]{200, 150, 100, 50};
  41     static JDialog[] dlgs = new JDialog[4];
  42     private static JFrame frame;
  43 
  44     public static void main(String args[]) throws Exception {
  45         SwingUtilities.invokeAndWait(() -> {
  46             frame = new JFrame("FRAME");
  47             frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  48             frame.setBounds(50, 50, 400, 400);


< prev index next >