Path: blob/master/test/jdk/javax/swing/JFileChooser/6840086/bug6840086.java
41154 views
/*1* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/* @test24@bug 684008625@summary JFileChooser lacks icons on top right when running on Windows 726@author Pavel Porvatov27@library /test/lib28@modules java.desktop/sun.awt.shell29@build jdk.test.lib.Platform30@run main bug684008631*/3233import jdk.test.lib.Platform;34import sun.awt.shell.ShellFolder;3536import java.awt.*;3738public class bug6840086 {39private static final String[] KEYS = {40"fileChooserIcon ListView",41"fileChooserIcon ViewMenu",42"fileChooserIcon DetailsView",43"fileChooserIcon UpFolder",44"fileChooserIcon NewFolder",45};4647public static void main(String[] args) {48if (!Platform.isWindows()) {49System.out.println("The test was skipped because it is sensible only for Windows.");5051return;52}5354for (String key : KEYS) {55Image image = (Image) ShellFolder.get(key);5657if (image == null) {58throw new RuntimeException("The image '" + key + "' not found.");59}6061if (image != ShellFolder.get(key)) {62throw new RuntimeException("The image '" + key + "' is not cached.");63}64}6566System.out.println("The test passed.");67}68}697071