test/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java

Print this page

        

@@ -74,11 +74,10 @@
 
         frame.addWindowListener(new WindowAdapter() {
             @Override
             public void windowClosing(WindowEvent event) {
                 System.err.println("User closed the window");
-                System.exit(1);
             }
         });
 
         HierarchyBoundsListener listener = new HierarchyBoundsListenerImpl();
         for (int i = 0; i < components.length; i++) {

@@ -129,11 +128,11 @@
         try {
             robot = new Robot();
             Thread.sleep(delay * 10);
         } catch (Exception e) {
             e.printStackTrace();
-            System.exit(1);
+            throw new RuntimeException("Robot creation exception.");
         }
 
         robot.mouseMove((int) components[0].getLocationOnScreen().x + components[0].getSize().width / 2,
                         (int) components[0].getLocationOnScreen().y + components[0].getSize().height / 2);
         robot.delay(delay);

@@ -593,19 +592,19 @@
     private static TestDialog dialog;
 
     public static void createDialogWithInstructions(String[] instructions) {
         dialog = new TestDialog(new Frame(), "Instructions");
         dialog.printInstructions(instructions);
-        dialog.setVisible(true);
+        //dialog.setVisible(true);
         println("Any messages for the tester will display here.");
     }
 
     public static void createDialog() {
         dialog = new TestDialog(new Frame(), "Instructions");
         String[] defInstr = {"Instructions will appear here. ", ""};
         dialog.printInstructions(defInstr);
-        dialog.setVisible(true);
+        //dialog.setVisible(true);
         println("Any messages for the tester will display here.");
     }
 
     public static void printInstructions(String[] instructions) {
         dialog.printInstructions(instructions);

@@ -641,11 +640,11 @@
         messageText = new TextArea("", 5, maxStringLength, scrollBoth);
         add("Center", messageText);
 
         pack();
 
-        setVisible(true);
+        //setVisible(true);
     }// TestDialog()
 
     //DO NOT call this directly, go through Sysout
     public void printInstructions(String[] instructions) {
         //Clear out any current instructions