Package java.awt

Examples of java.awt.Desktop.browse()


    if (!Desktop.isDesktopSupported()) return;
    try {
      Desktop desktop = Desktop.getDesktop();
      if (!desktop.isSupported(Desktop.Action.BROWSE)) return;
      closeAction();
      desktop.browse(new URI(Parameters.TWITTER_WEBPAGE));
    } catch (Exception e) {
      // Give up
    }
  }
 
View Full Code Here


         else if (resource instanceof URLResource)
         {
            Desktop dt = Desktop.getDesktop();
            try
            {
               dt.browse(((URLResource) resource).getUnderlyingResourceObject().toURI());
            }
            catch (URISyntaxException e)
            {
               throw new RuntimeException("Bad URL syntax: " + e.getInput(), e);
            }
View Full Code Here

                Desktop desktop = null;
                if (Desktop.isDesktopSupported()) {
                    desktop = Desktop.getDesktop();
                    if (desktop.isSupported(Desktop.Action.BROWSE)) {
                        try {
                            desktop.browse(u.toURI());
                        } catch (MalformedURLException e1) {
                            DialogUtils.showGeneralErrorDialog(new Frame(), "MalformedURLException", "Invalid URL.");
                        } catch (IOException e1) {
                            DialogUtils.showGeneralErrorDialog(new Frame(), "IOException", "Resource not found.");
                        } catch (URISyntaxException uriSyntaxEx) {
View Full Code Here

            if (Desktop.isDesktopSupported()) {
                desktop = Desktop.getDesktop();
                if (desktop.isSupported(Desktop.Action.BROWSE)) {
                    try {
                        URL url = new URL(puidUrl);
                        desktop.browse(url.toURI());
                    } catch (MalformedURLException e1) {
                        DialogUtils
                                .showGeneralErrorDialog(droidMainUi, "MalformedURLException", "Invalid URL.");
                    } catch (IOException e1) {
                        DialogUtils.showGeneralErrorDialog(droidMainUi, "IOException", "Resource not found.");
View Full Code Here

                String puid = (String) jTable1.getValueAt(jTable1.rowAtPoint(point), jTable1.columnAtPoint(point));
               
                Desktop desktop = Desktop.getDesktop();
                if (desktop.isSupported(Action.BROWSE)) {
                    try {
                        desktop.browse(URI.create(profileForm.getPronumURLPrefix(puid)));
                    } catch (IOException e) {
                        DialogUtils.showGeneralErrorDialog(
                                profileForm.getDroidMainUi(), "IOException", "Resource not found.");
                    }
                }
View Full Code Here

  private void openBrowserDialog() {
    // test if java desktop is supported
    if (Desktop.isDesktopSupported()) {
      Desktop desk = Desktop.getDesktop();
      try {
        desk.browse(new URI("http://www.jamesii.org"));
      } catch (IOException | URISyntaxException e) {
        SimSystem.report(e);
      }
    } else {
      JOptionPane.showMessageDialog(this,
View Full Code Here

     */
    public static void openWebpage(URI uri) {
        Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
        if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
            try {
                desktop.browse(uri);
            } catch (Exception e) {
                System.out.println("Error: cannot open web page");
            }
        }
    }
View Full Code Here

      }
      else if (resource instanceof URLResource)
      {
         try
         {
            dt.browse(((URLResource) resource).getUnderlyingResourceObject().toURI());
         }
         catch (URISyntaxException e)
         {
            throw new RuntimeException("Bad URL syntax: " + e.getInput(), e);
         }
View Full Code Here

        if (captcha) {
          Util.printConsole("SteamWeb: Captcha is needed.");
          final Desktop desktop = java.awt.Desktop.getDesktop();
          if (desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
            try {
              desktop.browse(new URI("https://steamcommunity.com/public/captcha.php?gid=" + loginJson.captcha_gid));
            } catch (IOException | URISyntaxException e) {
              e.printStackTrace();
            }

            final InputStreamReader isr = new InputStreamReader(System.in);
View Full Code Here

  private static void launchUrl(String url) {
    if (Desktop.isDesktopSupported()) {
      try {
        Desktop desktop = Desktop.getDesktop();
        if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
          desktop.browse(new URI(url));
        }
      } catch (Exception e) {
        LOGGER.error("", 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.