Package java.awt

Examples of java.awt.Desktop.open()


            showError(component, e);
            return;
        }

        try {
            desktop.open(file);
        } catch (Exception e) {
            if (e instanceof IOException) {
                copy(component, file);
            } else {
                showError(component, e);
View Full Code Here


            showError(component, e);
            return;
        }

        try {
            desktop.open(file);
        } catch (Exception e) {
            if (e instanceof IOException) {
                copy(component, file);
            } else {
                showError(component, e);
View Full Code Here

          private void openFile(String zipFilename) {
            if (Desktop.isDesktopSupported()) {
              Desktop dt = Desktop.getDesktop();
              try {
                dt.open(new File(zipFilename));
              }
              catch (Exception ex) {
                ex.printStackTrace();
              }
            }
View Full Code Here

   */
  boolean open() throws IOException, IllegalArgumentException {
    if ((path != null) && Desktop.isDesktopSupported()) {
      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(Desktop.Action.OPEN)) {
        desktop.open(new File(path));
        return true;
      }
    }
    return false;
  }
View Full Code Here

   */
  boolean open() throws IOException, IllegalArgumentException {
    if (path != null && Desktop.isDesktopSupported()) {
      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(Desktop.Action.OPEN)) {
        desktop.open(new File(path));
        return true;
      }
    }
    return false;
  }
View Full Code Here

                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);
            } finally {
View Full Code Here

            showError(component, e);
            return;
        }

        try {
            desktop.open(file);
        } catch (Exception e) {
            if (e instanceof IOException) {
                copy(component, file);
            } else {
                showError(component, e);
View Full Code Here

        } else if (ProjectManager.singleton instanceof FileProjectManager) {
            File dir = ((FileProjectManager) ProjectManager.singleton).getWorkspaceDir();

            if (Desktop.isDesktopSupported()) {
                Desktop desktop = Desktop.getDesktop();
                desktop.open(dir);
            } else /* if Mac */ {
                Runtime.getRuntime().exec(
                        "open .",
                        new String[] {},
                        dir
View Full Code Here

  public static void open(File document) {
    if (!document.exists()) return;
    try {
      Desktop dt = Desktop.getDesktop();
      dt.open(document);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      for (Resource<?> resource : dirs)
      {
         if (resource instanceof FileResource<?>)
         {
            Desktop dt = Desktop.getDesktop();
            dt.open((File) resource.getUnderlyingResourceObject());
         }
      }
   }
}
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.