0
package app;

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


public class App {

    public static void main(String[] args {


        UIManager.setLookAndFeel(UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel"));
        //run the GUI
        UI GUI = new UI();
        GUI.setVisible(true);
    }
}

I have the seaglasslookandfeel-0.2.jar file in the same package as my code, as well as added the jar to the compile libraries in NetBeans, but I keep getting a 'void type not allowd here' error when trying to set the LnF. This error is for the UIManager.... line.

If I take out the " " I get 'symbol not found: seaglasslookandfeel'

Any ideas?

Josh
  • 164
  • 4
  • 16
  • *"I have the seaglasslookandfeel-0.2.jar file in the same package as my code"* If by that you mean it is in the `app` directory of the file system, that's the wrong place for it. *"as well as added the jar to the compile libraries in NetBeans"* It is not necessary to add it to the compilation class-path, it **is** necessary to add it to the **run-time** class-path. – Andrew Thompson Jul 18 '18 at 01:46
  • So you're saying delete it from the project all together, remove it from compile library, and add it to the 'Run' library? – Josh Jul 18 '18 at 01:50
  • Basically, yes. Remove the import for it (unnecessary when using reflection to load classes), and add it to the run-time class-path. – Andrew Thompson Jul 18 '18 at 01:52
  • I've done this, and I'm still given `error: 'void' type not allowed here UIManager.setLookAndFeel(UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel"))` – Josh Jul 18 '18 at 01:54
  • Oh right.. `UIManager.setLookAndFeel(UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel"))` should be `UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel")` – Andrew Thompson Jul 18 '18 at 01:56
  • It's the simplest things.. how'd I miss I posted that snippet twice. Thanks for your help! – Josh Jul 18 '18 at 01:57

1 Answers1

0

Solved, the issue was I had UIManager twice.

Josh
  • 164
  • 4
  • 16