創建罐子後不出現靈氣外觀 當我在NetBeans中運行程序時Nimbus的外觀&感覺工作完美,但當我創建Jar並運行時應用程序從罐子時間nimbus外觀&的感覺是不會出現 CODE:創建罐子後不會出現靈氣外觀
public static void main(String[] args)
{
boolean isNimbus = false;
try {
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels())
{
if ("Nimbus".equals(info.getName()))
{
UIManager.setLookAndFeel(info.getClassName());
isNimbus = true;
break;
}
}
if(!isNimbus)
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
} catch (ClassNotFoundException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
} catch (UnsupportedLookAndFeelException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
Dashboard dashboardObj = new Dashboard();
}
獲取代碼中有'java.version',並報告它對IDE和Jar所說的內容。我猜IDE設置爲使用等於或晚於1.6.0_10的版本,而Jar在此之前使用了一個版本。 –