Package java.awt

Examples of java.awt.Desktop.browse()


    URI uri = new URI("http://eclipse.baeyens.it/installAdvice.shtml");

    Desktop desktop = null;
    if (Desktop.isDesktopSupported()) {
        desktop = Desktop.getDesktop();
        desktop.browse(uri);
        openedDialog = true;
    }
      } catch (URISyntaxException e) {
    e.printStackTrace();
      } catch (IOException e) {
View Full Code Here


          Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
          URL url;
          if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
              try {
            url = new URL("http://ardublock.com");
                  desktop.browse(url.toURI());
              } catch (Exception e1) {
                  e1.printStackTrace();
              }
          }
      }
View Full Code Here

    // TODO add your handling code here:
    int result = MessageBoxCreator.showQuestionBox(this, "Buka Website", "Aplikasi akan membuka website StripBandunk \nhttp://stripbandunk.com/", new String[]{"Buka Website", "Batalkan"}, 0);
    if (result == 0) {
        try {
            Desktop desktop = Desktop.getDesktop();
            desktop.browse(new URI("http://stripbandunk.com/"));
        } catch (IOException ex) {
            Logger.getLogger(Form.class.getName()).log(Level.SEVERE, null, ex);
        } catch (URISyntaxException ex) {
            Logger.getLogger(Form.class.getName()).log(Level.SEVERE, null, ex);
        }
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

    private void openUri(URI uri) {
        if ((uri != null) && Desktop.isDesktopSupported()) {
            final Desktop desktop = Desktop.getDesktop();
            if (desktop.isSupported(Desktop.Action.BROWSE)) {
                try {
                    desktop.browse(uri);
                } catch (IOException | RuntimeException e) {
                    logger.error("Could not browse URI '{}' with desktop!", uri, e);
                }
            }
        }
View Full Code Here

            Desktop desktop = Desktop.getDesktop();
            if (!desktop.isSupported(Desktop.Action.BROWSE))
                throw new IOException(Messages.DesktopAPIBrowserActionNotSupported);

            desktop.browse(target);
        }
        catch (IOException e)
        {
            PortfolioPlugin.log(e);
            MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.LabelError,
View Full Code Here

    public void actionPerformed(ActionEvent ev) {
        /*if (Desktop.isDesktopSupported()) {*/
            Desktop desktop = Desktop.getDesktop();
            /*if (desktop.isSupported(Desktop.Action.BROWSE)) {*/
                try {
                    desktop.browse(new URI("http://gephi.org/users/support/"));
                } catch (Exception ex) {
                    Exceptions.printStackTrace(ex);
                }
            /*}
        }*/
 
View Full Code Here

    if (Desktop.isDesktopSupported()) {
      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(Action.BROWSE)) {
        try {
          desktop.browse(URI.create(url));
          // return;
        } catch (IOException e) {
          // handled below
        }
      }
View Full Code Here

      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(getType())) {
        try {
          switch (getType()) {
          case BROWSE:
            desktop.browse(getURI(app));
            return;
          case MAIL:
            desktop.mail(getURI(app));
            return;
          }
View Full Code Here

      desktop = Desktop.getDesktop();
    }

    if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
      try {
        desktop.browse(uri);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
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.