歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Java 中設置默認的樣式

Java 中設置默認的樣式

日期:2017/3/1 10:29:36   编辑:Linux編程
  1. private void setLF() {
  2. // Force SwingApp to come up in the System L&F
  3. String laf = UIManager.getSystemLookAndFeelClassName();
  4. try {
  5. // System.out.println("========================"+laf);
  6. UIManager.setLookAndFeel(laf);
  7. } catch (UnsupportedLookAndFeelException exc) {
  8. System.err.println("Warning: UnsupportedLookAndFeel: " + laf);
  9. } catch (Exception exc) {
  10. System.err.println("Error loading " + laf + ": " + exc);
  11. }
  12. }
Swing就會調用不同的系統中的UI元素。
Copyright © Linux教程網 All Rights Reserved