2014-09-11 79 views
-5

我已经下载了java的外观。它是Quaqua。它以ZIP格式下载。我的问题是如何将这种外观和感觉添加到我的程序中?我正在使用NetBeans 8.我使用Google搜索,发现不合适的结果。 所以告诉我适当的程序。 谢谢。无法设置Java外观和感觉

+0

请参阅http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/index.html – 2014-09-11 11:21:28

+1

“请告诉我适当的程序”。不,我们不会,除非你告诉我们你*实际上试过的*。 – hexafraction 2014-09-11 11:21:39

回答

2

您添加一个JAR文件到classpath中像任何其他lib和,并显示您的JFrame之前设置的LNF这样的:

UIManager.setLookAndFeel(quaqualnf); 
... 
JFrame frame = ... 

如果你把眼光放在开发指南不屑,你会发现这个:

public class MyApplication { 
    public static void main(String[] args) { 

     // set system properties here that affect Quaqua 
     // for example the default layout policy for tabbed 
     // panes: 
     System.setProperty(
      "Quaqua.tabLayoutPolicy","wrap" 

     ); 

     // set the Quaqua Look and Feel in the UIManager 
     try { 
       UIManager.setLookAndFeel(
        ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel(); 
      ); 
     // set UI manager properties here that affect Quaqua 
     ... 
     } catch (Exception e) { 
      // take an appropriate action here 
      ... 
     } 
     // insert your application initialization code here 
     ... 
    } 
}