test/jdk/javax/swing/JComboBox/6632953/bug6632953.java
changeset 49090 82c1fe23c469
parent 47216 71c04702a3d5
equal deleted inserted replaced
49089:149647adb633 49090:82c1fe23c469
     1 /*
     1 /*
     2  * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2010, 2018, 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.
    27  * @author Alexander Potochkin
    27  * @author Alexander Potochkin
    28  */
    28  */
    29 import javax.swing.JComboBox;
    29 import javax.swing.JComboBox;
    30 import javax.swing.SwingUtilities;
    30 import javax.swing.SwingUtilities;
    31 import javax.swing.UIManager;
    31 import javax.swing.UIManager;
       
    32 import javax.swing.UnsupportedLookAndFeelException;
    32 import javax.swing.plaf.metal.MetalComboBoxUI;
    33 import javax.swing.plaf.metal.MetalComboBoxUI;
    33 
    34 
    34 public class bug6632953 {
    35 public class bug6632953 {
    35 
    36 
    36     public static void main(String... args) throws Exception {
    37     public static void main(String... args) throws Exception {
    41 
    42 
    42                 for (UIManager.LookAndFeelInfo lafInfo
    43                 for (UIManager.LookAndFeelInfo lafInfo
    43                         : UIManager.getInstalledLookAndFeels()) {
    44                         : UIManager.getInstalledLookAndFeels()) {
    44                     try {
    45                     try {
    45                         UIManager.setLookAndFeel(lafInfo.getClassName());
    46                         UIManager.setLookAndFeel(lafInfo.getClassName());
       
    47                     } catch (UnsupportedLookAndFeelException ignored) {
       
    48                         continue;
    46                     } catch (Exception e) {
    49                     } catch (Exception e) {
    47                         throw new RuntimeException(e);
    50                         throw new RuntimeException(e);
    48                     }
    51                     }
    49                     MetalComboBoxUI ui = new MetalComboBoxUI();
    52                     MetalComboBoxUI ui = new MetalComboBoxUI();
    50                     ui.installUI(new JComboBox());
    53                     ui.installUI(new JComboBox());