如何使用java打开给定URL的所有链接?

如何使用java打开给定URL的所有链接?,java,hyperlink,interface,Java,Hyperlink,Interface,好的,我有使用firebox打开URL的代码。我只是想知道如何打开该页面上的所有链接,可以一次打开一个链接,也可以一次打开所有链接,但我只是想知道。我好像到处都找不到这个 字符串url= 提供一些用于打开URL的代码。你得到什么对象类型?字符串url=;ifDesktop.isDesktopSupported{Desktop Desktop=Desktop.getDesktop;try{Desktop.browsenew URIurl;}catch IOException | URISyntax

好的,我有使用firebox打开URL的代码。我只是想知道如何打开该页面上的所有链接,可以一次打开一个链接,也可以一次打开所有链接,但我只是想知道。我好像到处都找不到这个

字符串url=


提供一些用于打开URL的代码。你得到什么对象类型?字符串url=;ifDesktop.isDesktopSupported{Desktop Desktop=Desktop.getDesktop;try{Desktop.browsenew URIurl;}catch IOException | URISyntaxException e{//TODO自动生成的catch块e.printStackTrace;}}else{Runtime Runtime=Runtime.getRuntime;try{runtime.execxdg-open+url;}捕获IOException e{//TODO自动生成的捕获块e.printStackTrace;}代码不属于注释。如果要添加信息,请单击问题下方的“编辑”,添加该代码,并记住使用{}按钮设置其格式。
    if(Desktop.isDesktopSupported()){
        Desktop desktop = Desktop.getDesktop();
        try {

            desktop.browse(new URI(url));

        } catch (IOException | URISyntaxException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }else{
        Runtime runtime = Runtime.getRuntime();
        try {
            runtime.exec("xdg-open " + url);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }