< prev index next >

test/java/awt/Window/AlwaysOnTop/AlwaysOnTopFieldTest.java

Print this page
rev 14031 : 8160974: [TESTBUG] Mark more headful tests with @key headful.

This is a backport of fe58d505fffd from jdk9. 228/596 hunks apply without
modifications. 16 hunks required manual rework. The remainder were for files
not present in jdk8u.


  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 import java.awt.Dialog;
  24 import java.awt.Frame;
  25 import java.awt.Toolkit;
  26 import java.awt.Window;
  27 import sun.awt.SunToolkit;
  28 /**
  29  * @test

  30  * @bug 7081594
  31  * @author Alexander Scherbatiy
  32  * @summary Windows owned by an always-on-top window DO NOT automatically become always-on-top
  33  * @run main AlwaysOnTopFieldTest
  34  */
  35 public class AlwaysOnTopFieldTest {
  36 
  37     public static void main(String[] args) {
  38         SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
  39 
  40         Window window = new Frame("Window 1");
  41         window.setSize(200, 200);
  42         window.setAlwaysOnTop(true);
  43         window.setVisible(true);
  44         toolkit.realSync();
  45 
  46         Dialog dialog = new Dialog(window, "Owned dialog 1");
  47         dialog.setSize(200, 200);
  48         dialog.setLocation(100, 100);
  49         dialog.setVisible(true);




  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 import java.awt.Dialog;
  24 import java.awt.Frame;
  25 import java.awt.Toolkit;
  26 import java.awt.Window;
  27 import sun.awt.SunToolkit;
  28 /**
  29  * @test
  30  * @key headful
  31  * @bug 7081594
  32  * @author Alexander Scherbatiy
  33  * @summary Windows owned by an always-on-top window DO NOT automatically become always-on-top
  34  * @run main AlwaysOnTopFieldTest
  35  */
  36 public class AlwaysOnTopFieldTest {
  37 
  38     public static void main(String[] args) {
  39         SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
  40 
  41         Window window = new Frame("Window 1");
  42         window.setSize(200, 200);
  43         window.setAlwaysOnTop(true);
  44         window.setVisible(true);
  45         toolkit.realSync();
  46 
  47         Dialog dialog = new Dialog(window, "Owned dialog 1");
  48         dialog.setSize(200, 200);
  49         dialog.setLocation(100, 100);
  50         dialog.setVisible(true);


< prev index next >