javax.swing自带的几种显示风格.使用LookAndFeelInfo查看
2021-05-29 01:03
标签:nimbus ant layout equals event break public rgba exception 看代码: Metal javax.swing自带的几种显示风格.使用LookAndFeelInfo查看 标签:nimbus ant layout equals event break public rgba exception 原文地址:https://www.cnblogs.com/liangblog/p/14773692.html 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有:
Nimbus
文章标题:javax.swing自带的几种显示风格.使用LookAndFeelInfo查看
文章链接:http://soscw.com/index.php/essay/88887.html