BrowserLauncher 추가

master
mjkhan21 1 year ago
parent c6c81b4823
commit 8b4347d2b3

@ -0,0 +1,30 @@
package cokr.xit.foundation.web;
import java.awt.Desktop;
import java.net.URI;
/**
* @author mjkhan
*/
public class BrowserLauncher {
/** url .
* @param url URL
*/
public static final void launch(String url) {
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(new URI(url));
} catch (Exception e) {
e.printStackTrace();
}
} else {
try {
Runtime.getRuntime().exec(
String.format("rundll32 url.dll, FileProtocolHandler %s", url)
);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
Loading…
Cancel
Save