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

FontDesignMetrics NullPointerException #439

Closed
tferr opened this issue Dec 3, 2021 · 1 comment
Closed

FontDesignMetrics NullPointerException #439

tferr opened this issue Dec 3, 2021 · 1 comment
Milestone

Comments

@tferr
Copy link

tferr commented Dec 3, 2021

Just noticed this exception on MacOS 10.15.7, AdoptOpenJdk

java.lang.NullPointerException
	at sun.font.FontDesignMetrics$MetricsKey.init(FontDesignMetrics.java:217)
	at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:286)
	at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1113)
	at javax.swing.JComponent.getFontMetrics(JComponent.java:1626)
	at com.formdev.flatlaf.ui.FlatComboBoxUI$2.layoutContainer(FlatComboBoxUI.java:265)
	at java.awt.Container.layout(Container.java:1513)
	at java.awt.Container.doLayout(Container.java:1502)
	at java.awt.Container.validateTree(Container.java:1698)
	at java.awt.Container.validate(Container.java:1633)
	at javax.swing.plaf.basic.BasicComboBoxUI$Handler.propertyChange(BasicComboBoxUI.java:1753)
	at com.formdev.flatlaf.ui.FlatComboBoxUI.lambda$createPropertyChangeListener$0(FlatComboBoxUI.java:311)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at java.awt.Component.firePropertyChange(Component.java:8434)
	at java.awt.Component.setFont(Component.java:1907)
	at java.awt.Container.setFont(Container.java:1753)
	at javax.swing.JComponent.setFont(JComponent.java:2754)
	at sun.lwawt.LWComponentPeer.resetColorsAndFont(LWComponentPeer.java:334)
	at sun.lwawt.LWComponentPeer.<init>(LWComponentPeer.java:229)
	at sun.lwawt.LWChoicePeer.<init>(LWChoicePeer.java:53)
	at sun.lwawt.LWToolkit.createChoice(LWToolkit.java:279)
	at java.awt.Choice.addNotify(Choice.java:152)
	at java.awt.Container.addNotify(Container.java:2776)
	at java.awt.Window.addNotify(Window.java:770)
DevCharly added a commit that referenced this issue Dec 6, 2021
@DevCharly
Copy link
Collaborator

What a surprise: AWT components use Swing components internally on macOS. Didn't know this 😮

The exception is fixed in latest 1.6.5-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 1.6.5 milestone Dec 6, 2021
tferr added a commit to morphonets/SNT that referenced this issue Dec 12, 2021
This fixes an NPE with GenericDialogs when setting SNT's L&F to FlatLaf
See JFormDesigner/FlatLaf#439
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