This commit is contained in:
Kirill Romanov 2018-01-11 17:11:03 +03:00 committed by GitHub
parent ef2f0ad2db
commit e48eb648fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -80,8 +80,14 @@ class Desktop {
}
else if (java.awt.Desktop.isDesktopSupported() && java.awt.Desktop.getDesktop()
.isSupported(java.awt.Desktop.Action.BROWSE)) {
java.awt.Desktop.getDesktop()
.browse(uri);
EventQueue.invokeLater(() -> {
try {
java.awt.Desktop.getDesktop()
.browse(uri);
} catch (IOException | URISyntaxException e) {
throw new RuntimeException(e);
}
});
}
else {
throw new IOException("Current OS and desktop configuration does not support browsing for a URL");