Skip to content

Commit

Permalink
Fix required java version JoptionPane error message proper way.
Browse files Browse the repository at this point in the history
  • Loading branch information
makyr90 committed Jan 5, 2016
1 parent 076bb19 commit d5b9a27
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/com/_17od/upm/gui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,6 @@ public MainWindow(String title) throws ClassNotFoundException, InstantiationExce
ProblemReadingDatabaseFile {
super(title);

Preferences.load();

Translator.initialise();

Double jvmVersion = new Double(System.getProperty("java.specification.version"));
if (jvmVersion.doubleValue() < 1.4) {
JOptionPane.showMessageDialog(null, Translator.translate("requireJava14"), Translator.translate("problem"),
JOptionPane.ERROR_MESSAGE);
System.exit(1);
}

setIconImage(Util.loadImage("upm.gif").getImage());

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Expand Down Expand Up @@ -216,8 +205,18 @@ public static void main(String[] args) {
public void run() {
try {
// Use the System look and feel
Preferences.load();
Translator.initialise();
Double jvmVersion = new Double(System.getProperty("java.specification.version"));
if (jvmVersion.doubleValue() < 1.9) {
JOptionPane.showMessageDialog(null, Translator.translate("requireJava14"), Translator.translate("problem"),
JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
else{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
AppWindow = new MainWindow(applicationName);
}

} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit d5b9a27

Please sign in to comment.