默认laf不加载

时间:2012-11-21 09:46:12

标签: swing solaris java uispec4j

我们使用solaris在服务器上运行构建。在将jre 1.6更改为jre 1.7之后,运行所有测试的实用程序开始抛出异常(对不起我的英语):

 [java] Exception in thread "main" java.lang.Error: Cannot load javax.swing.plaf.metal.MetalLookAndFeel
 [java]     at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1347)
 [java]     at javax.swing.UIManager.initialize(UIManager.java:1455)
 [java]     at javax.swing.UIManager.maybeInitialize(UIManager.java:1422)
 [java]     at javax.swing.UIManager.getDefaults(UIManager.java:656)
 [java]     at javax.swing.UIManager.put(UIManager.java:985)
 [java]     at org.uispec4j.interception.ui.UISpecLF.init(UISpecLF.java:11)
 [java]     at org.uispec4j.UISpec4J.init(UISpec4J.java:32)
 [java]     at org.uispec4j.UISpecTestCase.<clinit>(UISpecTestCase.java:31)
 [java]     at java.lang.Class.forName0(Native Method)
 [java]     at java.lang.Class.forName(Class.java:186)

我也尝试在build.xml中切换另一个laf来解决这个问题,但它没有帮助。

(jvmarg value =“ - Dswing.defaultlaf = com.jgoodies.looks.plastic.PlasticXPLookAndFeel”)

是什么原因?怎么修好了?

1 个答案:

答案 0 :(得分:0)

UIManager.setLookAndFeel( “com.sun.java.swing.plaf.motif.MotifLookAndFeel”) 像这样你需要通过将驱动程序加载到UIMangaer.setLookandFeel来添加金属外观和感觉