Changeset 3417 in josm
- Timestamp:
- 2010-08-05T15:29:36+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r3410 r3417 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 //Licence: GPL3 2 package org.openstreetmap.josm.gui; 4 3 … … 6 5 7 6 import java.awt.EventQueue; 7 import java.awt.GridBagConstraints; 8 import java.awt.GridBagLayout; 8 9 import java.awt.Toolkit; 9 10 import java.awt.event.WindowAdapter; … … 23 24 24 25 import javax.swing.JFrame; 26 import javax.swing.JLabel; 27 import javax.swing.JOptionPane; 28 import javax.swing.JPanel; 29 import javax.swing.JTextArea; 25 30 26 31 import org.openstreetmap.josm.Main; … … 134 139 public static void main(final String[] argArray) { 135 140 I18n.init(); 141 checkJava6(); 136 142 137 143 Policy.setPolicy(new Policy() { … … 277 283 */ 278 284 public static void removeObsoletePreferences() { 285 279 286 String[] obsolete = { 280 287 "proxy.anonymous", // 01/2010 - not needed anymore. Can be removed mid 2010 … … 288 295 } 289 296 } 297 298 private static void checkJava6() { 299 String version = System.getProperty("java.version"); 300 if (version != null) { 301 if (version.startsWith("1.6") || version.startsWith("6")) 302 return; 303 if (version.startsWith("1.5") || version.startsWith("5")) { 304 JLabel ho = new JLabel("<html>"+ 305 tr("<h2>JOSM requires Java version 6.</h2>"+ 306 "Detected Java version: {0}.<br>"+ 307 "You can <ul><li>update your Java (JRE) or</li>"+ 308 "<li>use an earlier (Java 5 compatible) version of JOSM.</li></ul>"+ 309 "More Info:", version)+"</html>"); 310 JTextArea link = new JTextArea("http://josm.openstreetmap.de/wiki/Help/SystemRequirements"); 311 link.setEditable(false); 312 link.setBackground(panel.getBackground()); 313 JPanel panel = new JPanel(new GridBagLayout()); 314 GridBagConstraints gbc = new GridBagConstraints(); 315 gbc.gridwidth = GridBagConstraints.REMAINDER; 316 gbc.anchor = GridBagConstraints.WEST; 317 gbc.weightx = 1.0; 318 panel.add(ho, gbc); 319 panel.add(link, gbc); 320 final String EXIT = tr("Exit JOSM"); 321 final String CONTINUE = tr("Continue, try anyway"); 322 int ret = JOptionPane.showOptionDialog(null, panel, tr("Error"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, new String[] {EXIT, CONTINUE}, EXIT); 323 if (ret == 0) { 324 System.exit(0); 325 } 326 return; 327 } 328 } 329 System.err.println("Error: Could not recognize Java Version: "+version); 330 } 290 331 }
Note:
See TracChangeset
for help on using the changeset viewer.