eclipse下已经把Substance.jar通过add external jar方式加了进去
代码如下
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;import org.pushingpixels.substance.api.skin.SubstanceGraphiteLookAndFeel;public class TheFrame extends JFrame {
/**
 * 
 */
private static final long serialVersionUID = 1L; public TheFrame() {
this.setSize(800, 700);
this.setIconImage(new ImageIcon("resources/left.png").getImage());
this.setVisible(true);
this.setLayout(null);
JButton b = new JButton("按钮");
JCheckBox c = new JCheckBox("CheckBox");
JLabel l = new JLabel("Jlabel");
this.add(b);
this.add(c);
this.add(l);
b.setBounds(20, 20, 80, 40);
c.setBounds(100, 50, 80, 40);
l.setBounds(200, 20, 80, 40);
this.setTitle("Subatance");
// this.setResizable(false);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} public static void main(String args[]) { JFrame.setDefaultLookAndFeelDecorated(true); SwingUtilities.invokeLater(new Runnable() { public void run() {
try {
UIManager
.setLookAndFeel("org.pushingpixels.substance.api.skin.SubstanceGraphiteLookAndFeel");
} catch (Exception e) {
System.out
.println("Substance Graphite failed to initialize");
} TheFrame f = new TheFrame();
}
}); }}
运行时报错
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/pushingpixels/trident/ease/TimelineEase

解决方案 »

  1.   

    你把jar放入你本项目lib中,你导入本项目lib中的substance.jar 试试...
      

  2.   

    还有就是你确定你那个"org.pushingpixels.substance.api.skin.SubstanceGraphiteLookAndFeel"写正确了?你可以用rar打开jar包看看,根据你写的这个路径,能找到对应的class文件么?
      

  3.   

    新版substance需要trident.jar。下载时substance应该可以看到