< prev index next >

test/jdk/javax/swing/JOptionPane/8024926/bug8024926.java

Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke


  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.BorderLayout;
  24 import java.awt.Dialog;
  25 import java.awt.EventQueue;
  26 import java.awt.Frame;
  27 import java.awt.TextArea;
  28 import javax.swing.JApplet;
  29 import javax.swing.JOptionPane;
  30 import jdk.testlibrary.OSInfo;

  31 
  32 /**
  33  * @test
  34  * @bug 8024926 8040279
  35  * @summary [macosx] AquaIcon HiDPI support
  36  * @author Alexander Scherbatiy
  37  * @library ../../../../lib/testlibrary
  38  * @build jdk.testlibrary.OSInfo
  39  * @run applet/manual=yesno bug8024926.html
  40  */
  41 public class bug8024926 extends JApplet {
  42     //Declare things used in the test, like buttons and labels here
  43 
  44     public void init() {
  45         //Create instructions for the user here, as well as set up
  46         // the environment -- set the layout manager, add buttons,
  47         // etc.
  48         this.setLayout(new BorderLayout());
  49 
  50 
  51         if (OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
  52             String[] instructions = {
  53                 "Verify that high resolution system icons are used"
  54                 + " in JOptionPane on HiDPI displays.",
  55                 "1) Run the test on Retina display or enable the Quartz Debug"
  56                 + " and select the screen resolution with (HiDPI) label",
  57                 "2) Check that the error icon on the JOptionPane is smooth",
  58                 "If so, press PASS, else press FAIL."
  59             };
  60             Sysout.createDialogWithInstructions(instructions);
  61 
  62         } else {
  63             String[] instructions = {
  64                 "This test is not applicable to the current platform. Press PASS."
  65             };
  66             Sysout.createDialogWithInstructions(instructions);
  67         }
  68 
  69 
  70     }//End  init()
  71 




  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.BorderLayout;
  24 import java.awt.Dialog;
  25 import java.awt.EventQueue;
  26 import java.awt.Frame;
  27 import java.awt.TextArea;
  28 import javax.swing.JApplet;
  29 import javax.swing.JOptionPane;
  30 
  31 import jdk.test.lib.Platform;
  32 
  33 /**
  34  * @test
  35  * @bug 8024926 8040279
  36  * @summary [macosx] AquaIcon HiDPI support
  37  * @author Alexander Scherbatiy
  38  * @library /test/lib
  39  * @build jdk.test.lib.Platform
  40  * @run applet/manual=yesno bug8024926.html
  41  */
  42 public class bug8024926 extends JApplet {
  43     //Declare things used in the test, like buttons and labels here
  44 
  45     public void init() {
  46         //Create instructions for the user here, as well as set up
  47         // the environment -- set the layout manager, add buttons,
  48         // etc.
  49         this.setLayout(new BorderLayout());
  50 
  51 
  52         if (Platform.isOSX()) {
  53             String[] instructions = {
  54                 "Verify that high resolution system icons are used"
  55                 + " in JOptionPane on HiDPI displays.",
  56                 "1) Run the test on Retina display or enable the Quartz Debug"
  57                 + " and select the screen resolution with (HiDPI) label",
  58                 "2) Check that the error icon on the JOptionPane is smooth",
  59                 "If so, press PASS, else press FAIL."
  60             };
  61             Sysout.createDialogWithInstructions(instructions);
  62 
  63         } else {
  64             String[] instructions = {
  65                 "This test is not applicable to the current platform. Press PASS."
  66             };
  67             Sysout.createDialogWithInstructions(instructions);
  68         }
  69 
  70 
  71     }//End  init()
  72 


< prev index next >