Package java.awt

Examples of java.awt.Desktop.browse()


            public void mouseClicked(MouseEvent me) {

                if (Desktop.isDesktopSupported()) {
                    Desktop desktop = Desktop.getDesktop();
                    try {
                        desktop.browse(new URI(strURL));
                    } catch (IOException e1) {
                        e1.printStackTrace();
                    } catch (URISyntaxException e1) {
                        e1.printStackTrace();
                    }
View Full Code Here


                ActionListener adminBrowserListener = new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        try {
                            URI uri = new URI(uriString);
                            desktop.browse(uri);

                        } catch (IOException e1) {
                            log.error("SYSTRAY: could not access system browser, access to "+label+" disabled");
                        } catch (URISyntaxException e1) {
                            log.error("SYSTRAY: could not build URI to administration service, access to "+label+" disabled");
View Full Code Here

                    if(desktop.isSupported(Desktop.Action.BROWSE) && serverName != null && serverPort > 0) {
                        try {


                            URI uri = new URI("http",null,serverName,serverPort,"/",null,null);
                            desktop.browse(uri);

                        } catch (Exception e1) {
                            System.err.println("could not open browser window, message was: "+e1.getMessage());
                        }
View Full Code Here

            @Override
            public void buttonPressed(Button button) {
                Desktop desktop = Desktop.getDesktop();

                try {
                    desktop.browse(new URL(YAHOO_FINANCE_HOME).toURI());
                } catch(MalformedURLException exception) {
                    throw new RuntimeException(exception);
                } catch(URISyntaxException exception) {
                    throw new RuntimeException(exception);
                } catch(IOException exception) {
View Full Code Here

                    String link = XML.getText(itemElement, "link");
                    Desktop desktop = Desktop.getDesktop();

                    try {
                        desktop.browse(new URL(link).toURI());
                    } catch(MalformedURLException exception) {
                        throw new RuntimeException(exception);
                    } catch(URISyntaxException exception) {
                        throw new RuntimeException(exception);
                    } catch(IOException exception) {
View Full Code Here

                    if(desktop.isSupported(Desktop.Action.BROWSE) && serverName != null && serverPort > 0) {
                        try {


                            URI uri = new URI("http",null,serverName,serverPort,"/",null,null);
                            desktop.browse(uri);

                        } catch (Exception e1) {
                            System.err.println("could not open browser window, message was: "+e1.getMessage());
                        }
View Full Code Here

                ActionListener adminBrowserListener = new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        try {
                            URI uri = new URI(uriString);
                            desktop.browse(uri);

                        } catch (IOException e1) {
                            log.error("SYSTRAY: could not access system browser, access to "+label+" disabled");
                        } catch (URISyntaxException e1) {
                            log.error("SYSTRAY: could not build URI to administration service, access to "+label+" disabled");
View Full Code Here

   
    private void openUrl(String url) {
        Desktop dt = Desktop.isDesktopSupported()? Desktop.getDesktop(): null;
        if(dt != null && dt.isSupported(Desktop.Action.BROWSE)) {
            try {
                dt.browse(new URI(url));
            }
            catch (URISyntaxException ex) {
                assert true: "Will never come here!";
            }
            catch(IOException ex) {
View Full Code Here

   
    private void openUrl(String url) {
        Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
        if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
            try {
                desktop.browse(new URI(url));
            }
            catch(URISyntaxException | IOException ex) {
                LOG.log(Level.INFO, "Error when opening browser", ex);
            }
        }
View Full Code Here

    // Plan A: try to open the URL using the Java 6 Desktop class
    if (Desktop.isDesktopSupported()) {
      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(Desktop.Action.BROWSE)) {
        try {
          desktop.browse(new URI(url));
          return; // success
        } catch (URISyntaxException e) {
          Logger.logError(e);
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.