Sea Glass 外观错误

Sea Glass look and feel error

你好,我正在尝试使用这个 seaglass 外观主题,但我得到的只是这个错误:

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

我下载了 seaglass jar 文件。并且仍然出现此错误。我检查了几个 Whosebug 帖子,但它们对我没有帮助...

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);
    }
}

只需从 mvnrepository.com or directly from the github project 下载它,因为所有内容都将包括在内,即使您丢失 class sun.swing.plaf.synth.SynthUI