Search code examples
javaswinglook-and-feelseaglass

Sea Glass look and feel error


Hello i am trying to use this seaglass look and feel theme and all i get is this error:

Exception in thread "main" java.lang.NoClassDefFoundError: sun/swing/plaf/synth/SynthUI

I downloaded seaglass jar file. And still get this error. I checked few stackoverflow posts but they didn't help me...

package lookandfeel;

import javax.swing.*;
import com.seaglasslookandfeel.*;

public class LookAndFeel
{

    public static void main(String[] args)
    {

        try
        {
            UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
        } catch (Exception e)
        {
            e.printStackTrace();
        }


        JFrame window = new JFrame("Look and feel");
        window.setVisible(true);
        window.setSize(500, 500);
        window.setResizable(false);
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPanel panel = new JPanel();
        window.add(panel);

        JButton button = new JButton("Look And Feel");
        panel.add(button);

        JProgressBar pb = new JProgressBar();
        pb.setValue(75);
        panel.add(pb);
    }
}

Solution

  • Simply download it from mvnrepository.com or directly from the github project because everything will be included even your missing class sun.swing.plaf.synth.SynthUI