diff options
Diffstat (limited to 'Dozentenmodul/src/util/OpenLinks.java')
| -rw-r--r-- | Dozentenmodul/src/util/OpenLinks.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Dozentenmodul/src/util/OpenLinks.java b/Dozentenmodul/src/util/OpenLinks.java index a3968825..2dd7b936 100644 --- a/Dozentenmodul/src/util/OpenLinks.java +++ b/Dozentenmodul/src/util/OpenLinks.java @@ -3,18 +3,23 @@ package util; import java.awt.Desktop; import java.net.URI; +import javax.swing.JOptionPane; + public class OpenLinks { - public static void openWebpage(URI uri) { - Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; - if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { - try { - desktop.browse(uri); - } catch (Exception e) { - e.printStackTrace(); - } - } + Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() + : null; + if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { + try { + desktop.browse(uri); + } catch (Exception e) { + e.printStackTrace(); + JOptionPane.showMessageDialog(null, + e.getCause() + "\n" + e.getStackTrace(), + "Debug-Message", JOptionPane.ERROR_MESSAGE); + } + } }// end openWebpage - + } |
