Java SE: Open Web Page and Click a Button

May 24, 2013 in answer

0 votes, 0.00 avg. rating (0% score)

ANSWER:

Your question is kind of difficult to understand what you want. If you have a webstart app and want to open a link in the browser, you can use the java.awt.Desktop.getDesktop().browse(URI) method.

public void openLinkInBrowser(ActionEvent event)

    try 
        URI uri = new URI(WEB_ADDRESS);
        java.awt.Desktop.getDesktop().browse(uri);

     catch (URISyntaxException | IOException e) 
        //System.out.println("THROW::: make sure we handle browser error");
        e.printStackTrace();
    

}

Matt8541 from http://stackoverflow.com/questions/16746179