|
Java example source code file (UiUtils.java)
The UiUtils.java Java example source codepackage org.deeplearning4j.ui; import java.awt.*; import java.net.URI; import org.slf4j.Logger; public class UiUtils { public static void tryOpenBrowser(String path, Logger log){ try{ UiUtils.openBrowser(new URI(path)); }catch(Exception e ){ // log.error("Could not open browser",e); System.out.println("Browser could not be launched automatically.\nUI path: " + path); } } public static void openBrowser(URI uri) throws Exception { if(Desktop.isDesktopSupported()){ Desktop.getDesktop().browse(uri); } else { throw new UnsupportedOperationException("Cannot open browser on this platform: Desktop.isDesktopSupported() == false"); } } } Other Java examples (source code examples)Here is a short list of links related to this Java UiUtils.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.