Package java.awt

Examples of java.awt.Desktop


                        tempReportFile.deleteOnExit();
                        report.createReport(parameters, groups, tempReportFile);

                        // show report
                        Desktop desktop = Desktop.getDesktop();
                        if (!desktop.isSupported(Desktop.Action.OPEN)) {
                            JOptionPane.showMessageDialog(owner, "Report: " + tempReportFile.getAbsolutePath(),
                                    "Report", JOptionPane.INFORMATION_MESSAGE);
                        } else {
                            desktop.open(tempReportFile);
                        }
                    } catch (Exception e) {
                        JOptionPane.showMessageDialog(owner, "Error: " + e.getMessage(), "Report Error",
                                JOptionPane.ERROR_MESSAGE);
                    }
View Full Code Here


    URI authUrl = new URI(url);

    if(Desktop.isDesktopSupported())
    {
      Desktop desktop = Desktop.getDesktop();

      if(desktop.isSupported(Desktop.Action.BROWSE))
      {
        desktop.browse(authUrl);
      }
      else
      {
        JOptionPane.showMessageDialog(null, "Visit the following URL: " + authUrl);
      }
View Full Code Here

        {
          URI websiteUri = new URI(websiteUrl);

          if(Desktop.isDesktopSupported())
          {
            Desktop desktop = Desktop.getDesktop();

            if(desktop.isSupported(Desktop.Action.BROWSE))
            {
              desktop.browse(websiteUri);
            }
            else
            {
              JOptionPane.showMessageDialog(null, websiteUrl);
            }
View Full Code Here

            if (!GfrOptionPaneAbs.s_showDialogConfirm(frmOwner, "Done : Export image gallery to folder", strBody))
               return;

            try
            {
               Desktop desktop = Desktop.getDesktop();
               desktop.open(fleFolderOut);
            }
            catch (Exception exc)
            {
               exc.printStackTrace();
               GfrOptionPaneAbs.s_showDialogError(frmOwner, "failed to launch default file manager");
View Full Code Here

            if (!GfrOptionPaneAbs.s_showDialogConfirm(frmOwner, "Done PDF image gallery", strBody))
               return;

            try
            {
               Desktop desktop = Desktop.getDesktop();
               desktop.open(fleOut);
            }
            catch (Exception exc)
            {
               exc.printStackTrace();
               GfrOptionPaneAbs.s_showDialogError(frmOwner, "failed to launch default PDF reader");
View Full Code Here

         if (blnIsDesktopSupported)
         {
            try
            {
               Desktop desktop = Desktop.getDesktop();
               desktop.open(fleOut);
            }
            catch (Exception exc)
            {
               exc.printStackTrace();
               GfrOptionPaneAbs.s_showDialogError(frmOwner, "failed to launch default PDF reader");
View Full Code Here

                } else if (count == 2
                    && feedListView.getItemAt(y) == index) {
                    Element itemElement = (Element)feedListView.getListData().get(index);

                    String link = XMLSerializer.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

        });

        yahooFinanceButton.getButtonPressListeners().add(new ButtonPressListener() {
            @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

    JMenu helpMenu = new JMenu(LocaleProps.get("HELP_MENU"));

    // If default browser support is available, add an online docs menu
    // items.
    if (Desktop.isDesktopSupported()) {
      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(Desktop.Action.BROWSE)) {
        // User manual.
        helpContentsItem = new JMenuItem(HELP_CONTENTS, KeyEvent.VK_H);
        helpContentsItem
            .addActionListener(createHelpContentsListener());
        helpMenu.add(helpContentsItem);
View Full Code Here

    javax.swing.SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        // Try to open the VStar online page in the default web
        // browser.
        if (Desktop.isDesktopSupported()) {
          Desktop desktop = Desktop.getDesktop();
          URL url = null;
          try {
            url = new URL(urlStr);
            java.net.URL helpURL = ResourceAccessor
                .getHelpHTMLResource();
            if (desktop.isSupported(Desktop.Action.BROWSE)) {
              try {
                desktop.browse(url.toURI());
              } catch (IOException e) {
                MessageBox.showErrorDialog("VStar Help",
                    "Error reading from '"
                        + helpURL.toString() + "'");
              } catch (URISyntaxException e) {
View Full Code Here

TOP

Related Classes of java.awt.Desktop

Copyright © 2018 www.massapicom. 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.