Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: NullPointerException in iconloader library #29

Open
AlexFalappa opened this issue Nov 29, 2016 · 2 comments
Open

Linux: NullPointerException in iconloader library #29

AlexFalappa opened this issue Nov 29, 2016 · 2 comments

Comments

@AlexFalappa
Copy link
Contributor

When trying to run the SwingSet2 demo on Ubuntu Linux with Oracle JDK I get the following exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at com.bulenkov.iconloader.IconLoader.<clinit>(IconLoader.java:53)
	at com.bulenkov.darcula.DarculaLaf.getDefaults(DarculaLaf.java:97)
	at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
	at javax.swing.UIManager.setLookAndFeel(UIManager.java:583)
	at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1349)
	at javax.swing.UIManager.initialize(UIManager.java:1459)
	at javax.swing.UIManager.maybeInitialize(UIManager.java:1426)
	at javax.swing.UIManager.getUI(UIManager.java:1006)
	at javax.swing.JPanel.updateUI(JPanel.java:126)
	at javax.swing.JPanel.<init>(JPanel.java:86)
	at javax.swing.JPanel.<init>(JPanel.java:109)
	at javax.swing.JPanel.<init>(JPanel.java:117)
	at SwingSet2.<init>(SwingSet2.java:182)
	at SwingSet2.main(SwingSet2.java:245)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.NullPointerException
	at com.bulenkov.iconloader.util.UIUtil.initSystemFontData(UIUtil.java:254)
	at com.bulenkov.iconloader.util.JBUI.calculateScaleFactor(JBUI.java:47)
	at com.bulenkov.iconloader.util.JBUI.<clinit>(JBUI.java:33)
	... 19 more

JDK:

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
@LukBukkit
Copy link

LukBukkit commented Dec 28, 2016

I had this issue too and found out that if you call UIManager.getFont("Label.font"); before you set the Look and Feel it works. Maybe the font is incorrect, but it works. However this is just a quick workaround.

@AlexFalappa AlexFalappa changed the title NullPointerException in iconloader library Linux: NullPointerException in iconloader library Jan 2, 2017
@AlexFalappa
Copy link
Contributor Author

AlexFalappa commented Jan 2, 2017

Verified the issue is Linux specific, it does not happen on the same machine under Windows 10 and Oracle JDK 8.

Edited title accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants