Changeset 4931 in josm for trunk/src/org


Ignore:
Timestamp:
2012-02-14T21:12:56+01:00 (8 years ago)
Author:
Don-vip
Message:

see #7386 - Speed up languages JComboBox initialization (from ~40ms to 5ms only)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/LanguagePreference.java

    r3293 r4931  
    3737    public void addGui(final PreferenceTabbedPane gui) {
    3838        model = new LanguageComboBoxModel();
     39        // Selecting the language BEFORE the JComboBox listens to model changes speed up initialization by ~35ms (see #7386)
     40        // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui
     41        model.selectLanguage(Main.pref.get("language"));
    3942        langCombo = new JComboBox(model);
    4043        langCombo.setRenderer(new LanguageCellRenderer(langCombo.getRenderer()));
    41         model.selectLanguage(Main.pref.get("language"));
    4244
    4345        LafPreference lafPreference = gui.getSetting(LafPreference.class);
Note: See TracChangeset for help on using the changeset viewer.