Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/net/sf/launch4j/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down
15 changes: 11 additions & 4 deletions src/net/sf/launch4j/formimpl/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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) {
Expand Down