< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2012, 2016, 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. --- 1,7 ---- /* ! * 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,85 **** framePressed = true; } }); f1 = new Frame("OtherFrame"); ! f1.setBounds(700, 100, 200, 200); w = new Window(f); w.setLayout(new FlowLayout()); b = new Button("Press"); b.addActionListener(new ActionListener() { --- 75,85 ---- framePressed = true; } }); f1 = new Frame("OtherFrame"); ! f1.setBounds(700, 100, 300, 300); w = new Window(f); w.setLayout(new FlowLayout()); b = new Button("Press"); b.addActionListener(new ActionListener() {
*** 87,97 **** System.out.println(e); buttonPressed = true; } }); w.add(b); ! w.setBounds(400, 100, 200, 200); w.setBackground(Color.blue); w.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { System.out.println(e); windowPressed = true; --- 87,97 ---- System.out.println(e); buttonPressed = true; } }); w.add(b); ! 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,115 **** f.setVisible(true); w.setVisible(true); frame = new Frame(); window1 = new Window(frame); ! window1.setBounds(0, 0, 100, 100); window1.setBackground(Color.blue); window2 = new Window(window1); ! window2.setBounds(0, 0, 50, 50); window2.setBackground(Color.green); tk = (sun.awt.SunToolkit)Toolkit.getDefaultToolkit(); try { --- 101,117 ---- f.setVisible(true); w.setVisible(true); frame = new Frame(); window1 = new Window(frame); ! window1.setSize(200, 200); ! window1.setLocationRelativeTo(null); window1.setBackground(Color.blue); window2 = new Window(window1); ! window2.setSize(100, 100); ! window2.setLocationRelativeTo(null); window2.setBackground(Color.green); tk = (sun.awt.SunToolkit)Toolkit.getDefaultToolkit(); try {
< prev index next >