Search code examples
javalook-and-feelseaglass

Unable to use Sea Glass LAF for the Java application


I am trying to use the Sea Glass LAF for a Java application but it gives the Class Not Found Exception (in Windows using JDK 8). I added the seaglass-0.1.7.3 jar file to the libraries folder and added it to build path. I also added import com.seaglasslookandfeel.*; to the code but it is shown as an unused import.

Below is my code:

public static void main( String[] args )
{
    EventQueue.invokeLater( new Runnable()
    {
        @Override
        public void run() 
        {
            try
            {
                UIManager.setLookAndFeel( "com.seaglasslookandfeel.SeaGlassLookAndFeel" );
                setHomeWindow( new HomeWindow() );
                window.getFrame().setVisible( true );

            }
            catch ( Exception e )
            {
                e.printStackTrace();
            }
        }
    } );
}

Here is the stack trace:

How can I solve this and use Seaglass? Any help is much appreciated.


Solution

  • I tried the following code and it works fine. I downloaded the seaglass jar from this link: http://www.java2s.com/Code/Jar/s/Downloadseaglasslookandfeel02jar.htm

    import java.awt.EventQueue;
    
    import javax.swing.JFrame;
    import javax.swing.UIManager;
    
    public class HomeWindow extends JFrame{
    
        public HomeWindow() {
            setTitle("look and feel demo");
            setSize(800, 600);
            setVisible(true);       
        }
    
            public static void main( String[] args )
            {
                EventQueue.invokeLater( new Runnable()
                {
                    @Override
                    public void run() 
                    {
                        try
                        {
                            UIManager.setLookAndFeel( "com.seaglasslookandfeel.SeaGlassLookAndFeel" );
                             new HomeWindow();                      
    
                        }
                        catch ( Exception e )
                        {
                            e.printStackTrace();
                        }
                    }
                } );
            }
    
    
    }