diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 34193e07dbf..2d30308bba7 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -250,13 +250,6 @@ public Base(String[] args) throws Exception { Theme.init(); System.setProperty("swing.aatext", PreferencesData.get("editor.antialias", "true")); - // Set the look and feel before opening the window - try { - BaseNoGui.getPlatform().setLookAndFeel(); - } catch (Exception e) { - // ignore - } - // Use native popups so they don't look so crappy on osx JPopupMenu.setDefaultLightWeightPopupEnabled(false); } else { diff --git a/app/src/processing/app/Theme.java b/app/src/processing/app/Theme.java index d38875b3597..17992338b61 100644 --- a/app/src/processing/app/Theme.java +++ b/app/src/processing/app/Theme.java @@ -57,6 +57,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import javax.swing.UIManager; import javax.swing.text.StyleContext; import org.apache.batik.transcoder.Transcoder; @@ -344,6 +345,28 @@ static protected void init() { // clone the hash table defaults = new PreferencesMap(table); + + // Set the look and feel before opening the window + try { + String laf = defaults.get("ui.laf"); + + if(laf != null && ! laf.trim().isEmpty()) { + + try { + UIManager.setLookAndFeel(laf); + } catch (Exception e) { + e.printStackTrace(); + BaseNoGui.getPlatform().setLookAndFeel(); + } + + }else { + BaseNoGui.getPlatform().setLookAndFeel(); + } + + } catch (Exception e) { + // ignore + } + } static private ZippedTheme openZipTheme() {