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 java.awt.*;
25 import java.util.ArrayList;
26 import javax.swing.*;
27
28 /*
29 * @test
30 * @key headful
31 * @summary Toplevel should be correctly positioned as relative to a component:
32 * so that their centers coincide
33 * or, if the component is hidden, centered on the screen.
34 * @bug 8036915
35 * @library ../../../../lib/testlibrary
36 * @build ExtendedRobot
37 * @run main/timeout=1200 SetLocationRelativeToTest
38 */
39
40 public class SetLocationRelativeToTest {
41 private static int delay = 500;
42 private static boolean testEverything = false;// NB: change this to true to test everything
43 java.util.List<Window> awtToplevels = new ArrayList<Window>();
44 java.util.List<Window> swingToplevels = new ArrayList<Window>();
45 java.util.List<Window> allToplevels = new ArrayList<Window>();
46 java.util.List<Component> awtComponents = new ArrayList<Component>();
47 java.util.List<Component> swingComponents = new ArrayList<Component>();
48 java.util.List<Component> allComponents = new ArrayList<Component>();
49 Label placeholder = new Label();
50 JLabel jplaceholder = new JLabel();
51 JFrame jcontainer;
52 public SetLocationRelativeToTest() {
53 Frame frame = new Frame("Frame");
54 frame.setSize(200,100);
55 Frame uframe = new Frame("U.Frame");
|
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 java.awt.*;
25 import java.util.ArrayList;
26 import javax.swing.*;
27
28 /*
29 * @test
30 * @key headful
31 * @summary Toplevel should be correctly positioned as relative to a component:
32 * so that their centers coincide
33 * or, if the component is hidden, centered on the screen.
34 * @bug 8036915
35 * @library ../../../../lib/client
36 * @build ExtendedRobot
37 * @run main/timeout=1200 SetLocationRelativeToTest
38 */
39
40 public class SetLocationRelativeToTest {
41 private static int delay = 500;
42 private static boolean testEverything = false;// NB: change this to true to test everything
43 java.util.List<Window> awtToplevels = new ArrayList<Window>();
44 java.util.List<Window> swingToplevels = new ArrayList<Window>();
45 java.util.List<Window> allToplevels = new ArrayList<Window>();
46 java.util.List<Component> awtComponents = new ArrayList<Component>();
47 java.util.List<Component> swingComponents = new ArrayList<Component>();
48 java.util.List<Component> allComponents = new ArrayList<Component>();
49 Label placeholder = new Label();
50 JLabel jplaceholder = new JLabel();
51 JFrame jcontainer;
52 public SetLocationRelativeToTest() {
53 Frame frame = new Frame("Frame");
54 frame.setSize(200,100);
55 Frame uframe = new Frame("U.Frame");
|