jdk/test/javax/swing/JFileChooser/4150029/bug4150029.java
changeset 20132 398fd7b83690
parent 7265 1a663d3536b6
child 26750 d0d6c64a2e2b
equal deleted inserted replaced
20131:59be23579a61 20132:398fd7b83690
     1 /*
     1 /*
     2  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    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
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /* @test
    24 /*
    25    @bug 4150029
    25    bug 4150029 8006087
    26    @summary BackSpace keyboard button does not lead to parent directory
    26    summary BackSpace keyboard button does not lead to parent directory
    27    @author Oleg Mokhovikov
    27    author Oleg Mokhovikov
    28    @run applet/manual=done bug4150029.html
       
    29 */
    28 */
    30 
    29 
    31 import javax.swing.*;
    30 import javax.swing.*;
    32 import java.io.File;
    31 import java.io.File;
    33 import java.io.IOException;
    32 import java.io.IOException;
    34 
    33 
    35 public class bug4150029 extends JApplet {
    34 public class bug4150029 extends JApplet {
    36     private boolean res;
    35     private boolean res;
    37 
    36 
    38     public void init() {
    37     public void init() {
       
    38         if (sun.awt.OSInfo.getOSType() == sun.awt.OSInfo.OSType.MACOSX) {
       
    39             try {
       
    40                 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
       
    41             } catch (Exception e) {
       
    42                 throw new RuntimeException(e);
       
    43             }
       
    44         }
       
    45 
    39         String tmpDir = System.getProperty("java.io.tmpdir");
    46         String tmpDir = System.getProperty("java.io.tmpdir");
    40 
    47 
    41         if (tmpDir.length() == 0) {//'java.io.tmpdir' isn't guaranteed to be defined
    48         if (tmpDir.length() == 0) {//'java.io.tmpdir' isn't guaranteed to be defined
    42             tmpDir = System.getProperty("user.home");
    49             tmpDir = System.getProperty("user.home");
    43         }
    50         }