Package java.awt

Examples of java.awt.Desktop.open()


        Desktop desktop = getDesktop();
        if (program == null || program.trim().length() == 0) {
            boolean launched = true;
            if (desktop != null) {
                try {
                    desktop.open(file);
                } catch (Exception exp) {
                  logger.debug("Could not launch file using the Dekstop class [" + file + "]", exp);
                    launched = false;
                }
            }
View Full Code Here


   */
  public static void openFile(final File file) throws Exception {
    final Desktop desktop = Desktop.isDesktopSupported() ? Desktop
        .getDesktop() : null;
        if ((desktop != null) && desktop.isSupported(Desktop.Action.OPEN)) {
          desktop.open(file);
        } else {
          final OperatingSystem system = Utils.getPlatform();
          switch (system) {
          case MAC:
          case WINDOWS:
View Full Code Here

   */
  public static void openFile(final File file) throws Exception {
    final Desktop desktop = Desktop.isDesktopSupported() ? Desktop
        .getDesktop() : null;
        if ((desktop != null) && desktop.isSupported(Desktop.Action.OPEN)) {
          desktop.open(file);
        } else {
          final OperatingSystem system = Utils.getPlatform();
          switch (system) {
          case MAC:
          case WINDOWS:
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

           // virtual machine (VM) on this particular host.
           if (Desktop.isDesktopSupported()) {
               desktop = Desktop.getDesktop();
               File file = new File(fileLoc);
               try {
            desktop.open(file);
          } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
           }
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);
                    }
View Full Code Here

               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

               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

        } catch (Exception e) {}
    }
   
    public static void openDocument(File document) throws IOException {
        Desktop dt = Desktop.getDesktop();
        dt.open(document);
    }

    public static String liesTextAusDatei(File datei, ParCollection params) {
        ArrayList<String> daten = new ArrayList<>(liesTextArray(datei, params));
        String s = "";
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.