mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
Linux: fixed NPE when using java.awt.TrayIcon (issue #405)
(cherry picked from commit 16a769ea61)
This commit is contained in:
@@ -14,6 +14,7 @@ FlatLaf Change Log
|
||||
`JTable.surrendersFocusOnKeystroke` is `true`) and
|
||||
`TextComponent.selectAllOnFocusPolicy` is `once` (the default) or `always`.
|
||||
(issue #395)
|
||||
- Linux: Fixed NPE when using `java.awt.TrayIcon`. (issue #405)
|
||||
|
||||
|
||||
## 1.6.1
|
||||
|
||||
@@ -264,6 +264,12 @@ public abstract class FlatLaf
|
||||
}
|
||||
};
|
||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||
|
||||
// make sure that AWT desktop properties are initialized (on Linux)
|
||||
// before invoking toolkit.addPropertyChangeListener()
|
||||
// https://github.com/JFormDesigner/FlatLaf/issues/405#issuecomment-960242342
|
||||
toolkit.getDesktopProperty( "dummy" );
|
||||
|
||||
toolkit.addPropertyChangeListener( desktopPropertyName, desktopPropertyListener );
|
||||
if( desktopPropertyName2 != null )
|
||||
toolkit.addPropertyChangeListener( desktopPropertyName2, desktopPropertyListener );
|
||||
|
||||
Reference in New Issue
Block a user