open URL in desktop

    0

    102

    Java Public Recipes

    Shortcut: awt.url.open

    import java.awt.*;
    import java.io.IOException;
    import java.net.URI;
    import java.net.URISyntaxException;
    
    try {
      Desktop.getDesktop().browse(new URI(url));
    } catch (IOException | URISyntaxException e1) {
      e1.printStackTrace();
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.