// Method kept because strings have already been translated. To enable for Java 8 migration somewhere in 2016
protected void askUpdateJava(final String version, final String url) {
GuiHelper.runInEDTAndWait(new Runnable() {
@Override
public void run() {
ExtendedDialog ed = new ExtendedDialog(
Main.parent,
tr("Outdated Java version"),
new String[]{tr("Update Java"), tr("Cancel")});
// Check if the dialog has not already been permanently hidden by user
if (!ed.toggleEnable("askUpdateJava8").toggleCheckState()) {
ed.setButtonIcons(new String[]{"java.png", "cancel.png"}).setCancelButton(2);
ed.setMinimumSize(new Dimension(480, 300));
ed.setIcon(JOptionPane.WARNING_MESSAGE);
String content = tr("You are running version {0} of Java.", "<b>"+version+"</b>")+"<br><br>";
if ("Sun Microsystems Inc.".equals(System.getProperty("java.vendor")) && !isOpenJDK()) {
content += "<b>"+tr("This version is no longer supported by {0} since {1} and is not recommended for use.",
"Oracle", tr("April 2015"))+"</b><br><br>";
}
content += "<b>"+tr("JOSM will soon stop working with this version; we highly recommend you to update to Java {0}.", "8")+"</b><br><br>"+
tr("Would you like to update now ?");
ed.setContent(content);
if (ed.showDialog().getValue() == 1) {
try {
openUrl(url);
} catch (IOException e) {
Main.warn(e);
}