Package java.awt

Examples of java.awt.Desktop.browse()


            public void mousePressed(MouseEvent arg0) {}
   
            public void mouseReleased(MouseEvent arg0) {
                Desktop desktop = Desktop.getDesktop();
                try {
              desktop.browse(new URI("http://www.pollux3d.org"));
            } catch (Exception e) {}
            }
          });
        }
      } catch (Exception e) {}
View Full Code Here


    @Override
    public void actionPerformed(final ActionEvent e) {
      if (Desktop.isDesktopSupported()) {
        final Desktop desktop = Desktop.getDesktop();
        try {
          desktop.browse(new URI("http://www.google.com/search?q=" + searchText.get().replaceAll(" ", "%20")));
        } catch (final Exception ignore) {
          // ignore
        }
      }
    }
View Full Code Here

    public static boolean browse(URI uri) throws IOException , UnavailableServiceException {
        // Try using the Desktop api first
        try {
            Desktop desktop = Desktop.getDesktop();
            desktop.browse(uri);

            return true;
        } catch (SecurityException e) {
//             Running in sandbox, try using WebStart service
            BasicService basicService =
View Full Code Here

   */
  public static void openURL(String url) {
    Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
    if (desktop != null && desktop.isSupported(Action.BROWSE)) {
      try {
        desktop.browse(new URI(url));
      } catch (Exception e) {
        JOptionPane.showMessageDialog(null, errMsg + ":\n" + e.getLocalizedMessage());
      }
    } else {
      fallbackURL(url);
View Full Code Here

          @Override
          public void onClickDo(final MouseEvent me) {
            if (Desktop.isDesktopSupported()) {
              final Desktop desktop = Desktop.getDesktop();
              try {
                desktop.browse(new URI("http://www.dcaiti.com"));
              } catch (final Exception e) {
                e.printStackTrace();
              }
            }
          }
View Full Code Here

          @Override
          public void onClickDo(final MouseEvent me) {
            if (Desktop.isDesktopSupported()) {
              final Desktop desktop = Desktop.getDesktop();
              try {
                desktop.browse(new URI("http://mapicons.nicolasmollet.com"));
              } catch (final Exception e) {
                e.printStackTrace();
              }
            }
          }
View Full Code Here

        // TODO add your handling code here:
        if (Desktop.isDesktopSupported()) {
            Desktop desktop = Desktop.getDesktop();
            if (desktop.isSupported(Desktop.Action.BROWSE)) {
                try {
                    desktop.browse(new URI("http://sourceforge.net/projects/w2sc/"));
                } catch (Exception e) {
                    System.out.println(e);
                }

            }
View Full Code Here

        // TODO add your handling code here:
        if (Desktop.isDesktopSupported()) {
            Desktop desktop = Desktop.getDesktop();
            if (desktop.isSupported(Desktop.Action.BROWSE)) {
                try {
                    desktop.browse(new URI(Way2SMSCore.downloadlink));
                } catch (Exception e) {
                    System.out.println(e);
                }

            }
View Full Code Here

    }

    URI uri;
    try {
      uri = new URI(url);
      desktop.browse(uri);
    } catch (URISyntaxException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
              Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
                if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
                    try {
                        desktop.browse(Cody.getInstancia().getLinkAjuda());
                    } 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.