< prev index next >

test/jdk/java/awt/Window/Grab/GrabTest.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -75,11 +75,11 @@
                     framePressed = true;
                 }
             });
 
         f1 = new Frame("OtherFrame");
-        f1.setBounds(700, 100, 200, 200);
+        f1.setBounds(700, 100, 300, 300);
 
         w = new Window(f);
         w.setLayout(new FlowLayout());
         b = new Button("Press");
         b.addActionListener(new ActionListener() {

@@ -87,11 +87,11 @@
                     System.out.println(e);
                     buttonPressed = true;
                 }
             });
         w.add(b);
-        w.setBounds(400, 100, 200, 200);
+        w.setBounds(400, 100, 300, 300);
         w.setBackground(Color.blue);
         w.addMouseListener(new MouseAdapter() {
                 public void mousePressed(MouseEvent e) {
                     System.out.println(e);
                     windowPressed = true;

@@ -101,15 +101,17 @@
         f.setVisible(true);
         w.setVisible(true);
 
         frame = new Frame();
         window1 = new Window(frame);
-        window1.setBounds(0, 0, 100, 100);
+        window1.setSize(200, 200);
+        window1.setLocationRelativeTo(null);
         window1.setBackground(Color.blue);
 
         window2 = new Window(window1);
-        window2.setBounds(0, 0, 50, 50);
+        window2.setSize(100, 100);
+        window2.setLocationRelativeTo(null);
         window2.setBackground(Color.green);
 
         tk = (sun.awt.SunToolkit)Toolkit.getDefaultToolkit();
 
         try {
< prev index next >