Hello Code Ranchers,
This is posted here instead of the Swing forum because I think it's not specific to Swing. I am attempting to add the jars for a 3rd party Look and Feel (Swing) to my project. I get an exception when running (below). I suspect I've imported the jars incorrectly or in a way which is incomplete.
This issue involves the use of WebLAF found here:
https://github.com/mgarin/weblaf
Instructions say, "First you will need to download one of the newest releases or add a
Maven dependency to your project as shown above. If you are not using Maven - don't forget to download all dependencies mentioned in release notes. Once you have all necessary binaries attached to your project you can to install WebLaF by simply calling WebLookAndFeel.install () or using one of standard Swing UIManager methods for installing L&F:"
I am not using Maven. So, I found the dependencies here:
https://github.com/mgarin/weblaf/tree/4bd1937a35c6297f68928532e1a8560dcd4f86d9/lib . I imported these into my project as though they were any other 3rd party library jar. The instructions also say to "download one of the newest releases". I'm not clear what this means outside of downloading the jars for WebLAF and adding those also. These are the only jars I can find which are specific to the latest release (scrolled down about 1/3 there are 17 jars):
https://github.com/mgarin/weblaf/releases . I import these jars also.
In main of my project I have:
Running this throws this exception:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.alee.managers.style.AbstractComponentDescriptor.updateDefaults(AbstractComponentDescriptor.java:236)
at com.alee.managers.style.StyleManager.registerComponentDescriptor(StyleManager.java:842)
at com.alee.managers.style.StyleManager.initializeDescriptors(StyleManager.java:463)
at com.alee.managers.style.StyleManager.initialize(StyleManager.java:266)
at com.alee.managers.UIManagers.initialize(UIManagers.java:73)
at com.alee.laf.WebLookAndFeel.initializeManagers(WebLookAndFeel.java:1063)
at com.alee.laf.WebLookAndFeel.initialize(WebLookAndFeel.java:389)
at java.desktop/javax.swing.UIManager.setLookAndFeel(UIManager.java:586)
at com.witphonehome.Swing$57.run(Swing.java:3512)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Does "download one of the newest releases" suggest installing anything else outside of importing the jars? There is also "Source code (zip)" and "Source code (tar.gz)" listed at the bottom of the list of WebLAF jars, but these seem to contain the original dependencies along with some other stuff. I don't know what this stuff is, and I don't see any explicit mention that I use any of this in my installation.
Any feedback is appreciated.