< prev index next >

test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java

Print this page
rev 17561 : 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests.
Summary: Add new keyword 'printer'. Some minor test fixes to show headless exception. Add some @requires windows.
   1 /*
   2  * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 
  24 import java.awt.*;
  25 /*

  26  * @test

  27  * @bug 8065739 8131339
  28  * @summary When Frame.setExtendedState(Frame.MAXIMIZED_BOTH)
  29  *          is called for a Frame after been called setMaximizedBounds() with
  30  *          certain value, Frame bounds must equal to this value.
  31  *
  32  * @run main SetMaximizedBounds
  33  */
  34 
  35 public class SetMaximizedBounds {
  36 
  37     public static void main(String[] args) throws Exception {
  38 
  39         //Supported platforms are Windows and OS X.
  40         String os = System.getProperty("os.name").toLowerCase();
  41         if (!os.contains("windows") && !os.contains("os x")) {
  42             return;
  43         }
  44 
  45         if (!Toolkit.getDefaultToolkit().
  46                 isFrameStateSupported(Frame.MAXIMIZED_BOTH)) {


   1 /*
   2  * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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 
  24 import java.awt.*;
  25 
  26 /**
  27  * @test
  28  * @key headful
  29  * @bug 8065739 8131339
  30  * @summary When Frame.setExtendedState(Frame.MAXIMIZED_BOTH)
  31  *          is called for a Frame after been called setMaximizedBounds() with
  32  *          certain value, Frame bounds must equal to this value.
  33  *
  34  * @run main SetMaximizedBounds
  35  */
  36 
  37 public class SetMaximizedBounds {
  38 
  39     public static void main(String[] args) throws Exception {
  40 
  41         //Supported platforms are Windows and OS X.
  42         String os = System.getProperty("os.name").toLowerCase();
  43         if (!os.contains("windows") && !os.contains("os x")) {
  44             return;
  45         }
  46 
  47         if (!Toolkit.getDefaultToolkit().
  48                 isFrameStateSupported(Frame.MAXIMIZED_BOTH)) {


< prev index next >