Skip to content

Commit

Permalink
Fix L&F for error message
Browse files Browse the repository at this point in the history
  • Loading branch information
comp500 committed May 17, 2019
1 parent b3cac7b commit d5128f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/link/infra/packwiz/installer/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package link.infra.packwiz.installer;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
Expand All @@ -23,6 +24,11 @@ public Main(String[] args) {
cmd = parser.parse(options, args);
} catch (ParseException e) {
e.printStackTrace();
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e1) {
// Ignore the exceptions, just continue using the ugly L&F
}
JOptionPane.showMessageDialog(null, e.getMessage(), "packwiz-installer", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
Expand All @@ -32,7 +38,7 @@ public Main(String[] args) {

// Called by packwiz-installer-bootstrap to set up the help command
public static void addNonBootstrapOptions(Options options) {
options.addOption("w", "welp", false, "Testing options");
//options.addOption("w", "welp", false, "Testing options");
}

// TODO: link these somehow so they're only defined once?
Expand Down

0 comments on commit d5128f7

Please sign in to comment.