码迷,mamicode.com
首页 > 编程语言 > 详细

javax.swing自带的几种显示风格.使用LookAndFeelInfo查看

时间:2021-05-24 12:36:02      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:nimbus   ant   layout   equals   event   break   public   rgba   exception   

   public static void main(String args[]) {
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainGroupLayoutUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainGroupLayoutUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainGroupLayoutUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainGroupLayoutUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }


        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainUI().setVisible(true);
            }
        });


    }

看代码: 

Swing有几种自带的LookAndFeel有:

Metal
Nimbus

 

javax.swing自带的几种显示风格.使用LookAndFeelInfo查看

标签:nimbus   ant   layout   equals   event   break   public   rgba   exception   

原文地址:https://www.cnblogs.com/liangblog/p/14773692.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!