I'm using netbeans for my java project and I want to add synthetica look and feel to my project.
This is my code to set Synthetica look and feel
public static void main(String[] args) {
MainFrame mf = new MainFrame();
try{
UIManager.setLookAndFeel(new SyntheticaSilverMoonLookAndFeel());
mf.setVisible(true);
mf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}catch(Exception e){
System.out.println(e);
}
}
I have already added synthetica.jar
and syntheticaSilverMoon.jar
to my libraries.
But when i'm trying to run the project it gives me
Exception in thread "main" java.lang.NoClassDefFoundError: sun/swing/plaf/synth/SynthUI
at de.javasoft.plaf.synthetica.SyntheticaDefaultLookup.getDefault(SyntheticaDefaultLookup.java:84)
at sun.swing.DefaultLookup.get(DefaultLookup.java:125)
at javax.swing.plaf.basic.BasicButtonListener.getInputMap(BasicButtonListener.java:119)
at javax.swing.plaf.basic.BasicButtonListener.installKeyboardActions(BasicButtonListener.java:95)
at javax.swing.plaf.basic.BasicButtonUI.installKeyboardActions(BasicButtonUI.java:138)
at javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:90)
at javax.swing.JComponent.setUI(JComponent.java:666)
at javax.swing.AbstractButton.setUI(AbstractButton.java:1810)
at javax.swing.JButton.updateUI(JButton.java:147)
at javax.swing.AbstractButton.init(AbstractButton.java:2176)
at javax.swing.JButton.<init>(JButton.java:137)
at javax.swing.JButton.<init>(JButton.java:91)
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.installCompatibilityDefaults(SyntheticaLookAndFeel.java:553)
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.access$4(SyntheticaLookAndFeel.java:405)
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel$2.propertyChange(SyntheticaLookAndFeel.java:313)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:92)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:548)
at courseenrollmentsystem.CourseEnrollmentSystem.main(CourseEnrollmentSystem.java:26)
Caused by: java.lang.ClassNotFoundException: sun.swing.plaf.synth.SynthUI
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 21 more
What is the wrong with my code? Need help.