Hallo,
ich versuche ein L&F ("Substance") einzubinden. Habe in Eclipse bereits über "Window-Preferences-Java-Classpath Variables" die "substance.jar" geadded.
Wenn ich das Programm laufen lasse kommt der Fehler "Substance not found" - also ein ClassNotFoundException.
Wie mache ich "org.jvnet.substance.SubstanceLookAndFeel" dem Programm bekannt?
Was muss ich wie adden, damit das L&F funktioniert?
ich versuche ein L&F ("Substance") einzubinden. Habe in Eclipse bereits über "Window-Preferences-Java-Classpath Variables" die "substance.jar" geadded.
Wenn ich das Programm laufen lasse kommt der Fehler "Substance not found" - also ein ClassNotFoundException.
Wie mache ich "org.jvnet.substance.SubstanceLookAndFeel" dem Programm bekannt?
Was muss ich wie adden, damit das L&F funktioniert?
Code:
package zwei;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Walkthrough extends JFrame {
public Walkthrough() {
super("Sample app");
this.setLayout(new FlowLayout());
this.add(new JButton("button"));
this.add(new JCheckBox("check"));
this.add(new JLabel("label"));
this.pack();
this.setSize(this.getPreferredSize());
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
try {
UIManager
.setLookAndFeel("org.jvnet.substance.SubstanceLookAndFeel");
} catch (UnsupportedLookAndFeelException ulafe) {
System.out.println("Substance failed to set");
} catch (ClassNotFoundException cnfe) {
System.out.println("Substance not found");
} catch (InstantiationException ie) {
System.out.println("Substance failed to instantiate");
} catch (IllegalAccessException iae) {
System.out.println("Access denied");
}
Walkthrough w = new Walkthrough();
w.setVisible(true);
}
}