summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/util/OpenLinks.java
blob: a3968825e67a77ab3b58f09dba1f2d84cae7f1a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package util;

import java.awt.Desktop;
import java.net.URI;

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();
	        }
	    }
	}// end openWebpage
	
}