javax.swing自带的几种显示风格.使用LookAndFeelInfo查看
Posted 凉城
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javax.swing自带的几种显示风格.使用LookAndFeelInfo查看相关的知识,希望对你有一定的参考价值。
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查看的主要内容,如果未能解决你的问题,请参考以下文章
Tools/macOS系列iPad作为扩展显示屏的几种解决方案