Karl Tauber created NETBEANS-3664:
-------------------------------------

             Summary: Using wrong LaF getDefaults() method slows down startup
                 Key: NETBEANS-3664
                 URL: https://issues.apache.org/jira/browse/NETBEANS-3664
             Project: NetBeans
          Issue Type: Bug
            Reporter: Karl Tauber


There are (at least) two places where 
{{UIManager.getLookAndFeel().getDefaults()}} is used to get look and feel UI 
defaults.

But this method creates a new hash table with about 600+ entries filled with 
colors, icons, fonts, insets, etc., which takes some milliseconds. In case of 
FlatLaf, also several properties files are read and parsed.

The javadoc of {{LookAndFeel.getDefaults()}} also states that this method 
should only be invoked by the {{UIManager}}.

The correct method to use would be {{UIManager.getLookAndFeelDefaults()}}, 
which returns an existing hash table that was created earlier with 
{{LookAndFeel.getDefaults()}}.

I'll create a PR to fix this...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to