jdk/test/javax/swing/plaf/basic/Test6984643.java
author rupashka
Thu, 14 Oct 2010 13:33:00 +0400
changeset 6837 5beeaa777490
permissions -rw-r--r--
6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed Reviewed-by: alexp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6837
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     1
/*
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     4
 *
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     8
 *
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    13
 * accompanied this code).
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    14
 *
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    18
 *
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    21
 * questions.
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    22
 */
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    23
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    24
/*
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    25
 * @test
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    26
 * @bug 6984643
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    27
 * @summary Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    28
 * @author Pavel Porvatov
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    29
 */
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    30
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    31
import javax.swing.*;
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    32
import javax.swing.plaf.basic.BasicLookAndFeel;
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    33
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    34
public class Test6984643 {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    35
    public static void main(String[] args) throws Exception {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    36
        UIManager.setLookAndFeel(new BasicLookAndFeel() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    37
            public String getName() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    38
                return "A name";
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    39
            }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    40
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    41
            public String getID() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    42
                return "An id";
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    43
            }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    44
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    45
            public String getDescription() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    46
                return "A description";
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    47
            }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    48
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    49
            public boolean isNativeLookAndFeel() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    50
                return false;
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    51
            }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    52
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    53
            public boolean isSupportedLookAndFeel() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    54
                return true;
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    55
            }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    56
        });
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    57
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    58
        SwingUtilities.invokeLater(new Runnable() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    59
            public void run() {
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    60
                new JFileChooser();
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    61
            }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    62
        });
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    63
    }
5beeaa777490 6984643: Unable to instantiate JFileChooser with a minimal BasicL&F descendant installed
rupashka
parents:
diff changeset
    64
}