diff --git a/src/net/sf/launch4j/Util.java b/src/net/sf/launch4j/Util.java index b1006b8..05a34d8 100644 --- a/src/net/sf/launch4j/Util.java +++ b/src/net/sf/launch4j/Util.java @@ -56,7 +56,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE public class Util { public static final boolean WINDOWS_OS = System.getProperty("os.name") .toLowerCase().startsWith("windows"); - + + public static final boolean MAC_OS = System.getProperty("os.name") + .toLowerCase().startsWith("mac os"); + private static final String Launch4jProperties = "launch4j.properties"; private Util() {} diff --git a/src/net/sf/launch4j/formimpl/MainFrame.java b/src/net/sf/launch4j/formimpl/MainFrame.java index 2799bdb..b02ccad 100644 --- a/src/net/sf/launch4j/formimpl/MainFrame.java +++ b/src/net/sf/launch4j/formimpl/MainFrame.java @@ -54,8 +54,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import javax.swing.UIManager; import com.jgoodies.looks.Options; -import com.jgoodies.looks.plastic.PlasticXPLookAndFeel; -import com.jgoodies.looks.windows.WindowsLookAndFeel; import foxtrot.Task; import foxtrot.Worker; @@ -78,6 +76,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE public class MainFrame extends JFrame { private static MainFrame _instance; + private static final String WINDOWS_LNF = "com.jgoodies.looks.windows.WindowsLookAndFeel"; + private static final String PLASTICXP_LNF = "com.jgoodies.looks.plastic.PlasticXPLookAndFeel"; + private final JToolBar _toolBar; private final JButton _runButton; private final ConfigFormImpl _configForm; @@ -95,8 +96,14 @@ public static void createInstance() { Options.setUseNarrowButtons(false); Options.setPopupDropShadowEnabled(true); - UIManager.setLookAndFeel(System.getProperty("os.name").toLowerCase().startsWith("windows") - ? new WindowsLookAndFeel() : new PlasticXPLookAndFeel()); + if (Util.WINDOWS_OS) { + UIManager.setLookAndFeel(WINDOWS_LNF); + } else if (Util.MAC_OS) { + String systemClassName = UIManager.getSystemLookAndFeelClassName(); + UIManager.setLookAndFeel(systemClassName); + } else { + UIManager.setLookAndFeel(PLASTICXP_LNF); + } _instance = new MainFrame(); } catch (Exception e) {