Examples of showSaveDialog()


Examples of javax.swing.JFileChooser.showSaveDialog()

  private void showSaveLogFileAsDialog() {
    // Create a file chooser
    final JFileChooser fileChooser = new JFileChooser();

    // In response to a button click:
    int returnVal = fileChooser.showSaveDialog(frame);

    if (returnVal == JFileChooser.APPROVE_OPTION) {
      File file = fileChooser.getSelectedFile();

      saveLogFile(file);
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

          String string = getDataModel().getFileSet().getDir();
          if (string != null) {
            fileDialog.setCurrentDirectory(new File(string));
          }
          int retVal = fileDialog.showSaveDialog(TreeViewFrame.this);
          if (retVal == JFileChooser.APPROVE_OPTION) {
            File chosen = fileDialog.getSelectedFile();
            String name = chosen.getName();
            if (!name.toLowerCase().endsWith(".cdt") && !name.toLowerCase().endsWith(".pcl"))
              name += ".cdt";
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

            }
        }
       
        try {
            for(;;) {
                int userChoice = fc.showSaveDialog(myWorkbenchFacade.getMainFrame());
                if (userChoice!=JFileChooser.APPROVE_OPTION) {
                    break;
                }
                File projectfile = fc.getSelectedFile();
                String extension = FileUtil.getExtension(projectfile).toLowerCase();
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

  private void onSave() {
    if(playlist.size() > 0) {
      JFileChooser fc = new JFileChooser();
      fc.addChoosableFileFilter(new MyFilter());

      int returnVal = fc.showSaveDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        String url = fc.getSelectedFile().getAbsolutePath();
        if(url.endsWith(".m3u"))
          url = url.substring(0, url.length() - 4);
        url += ".m3u";
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

            }
        };

        final JFileChooser chooser = new JFileChooser();
        chooser.setFileFilter(myFilter);
        final int returnVal = chooser.showSaveDialog(this);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
            File f = chooser.getSelectedFile();
            if( !f.getName().endsWith(".xml") ) {
                f = new File(f.getPath() + ".xml");
            }
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

            // (ulrivo): set default directory if set from command line
            if (defDirectory != null) {
                f.setCurrentDirectory(new File(defDirectory));
            }

            int option = f.showSaveDialog((Component) fMain);

            if (option == JFileChooser.APPROVE_OPTION) {
                File file = f.getSelectedFile();

                if (file != null) {
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

            // (ulrivo): set default directory if set from command line
            if (defDirectory != null) {
                f.setCurrentDirectory(new File(defDirectory));
            }

            int option = f.showSaveDialog((Component) fMain);

            if (option == JFileChooser.APPROVE_OPTION) {
                File file = f.getSelectedFile();

                if (file != null) {
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

    }
    fileChooser.setDialogTitle(dialogTitle);
   
    int option;
    if (save) {
      option = fileChooser.showSaveDialog((JComponent)parentView);
    } else {
      option = fileChooser.showOpenDialog((JComponent)parentView);
    }   
    if (option == JFileChooser.APPROVE_OPTION) {
      // Retrieve current directory for future calls
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

        int returnVal = chooser.showOpenDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
          String srcFilename = chooser.getSelectedFile().getAbsolutePath();
          chooser.setDialogTitle("Select destination image file");
          chooser.setDialogType(JFileChooser.SAVE_DIALOG);
          returnVal = chooser.showSaveDialog(null);
          if (returnVal == JFileChooser.APPROVE_OPTION) {
            String dstFilename = chooser.getSelectedFile().getAbsolutePath();
            try {
              converter.convertImage(srcFilename, dstFilename);
              returnVal = JOptionPane.showOptionDialog(null,
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

  private void jSaveToFileActionPerformed(java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jSaveToFileActionPerformed
    JFileChooser fc = new JFileChooser(".");
    fc.setSelectedFile(new File(EditorXML.itemsFile));
    fc.setDialogTitle("Choose items XML file to save");
    int returnVal = fc.showSaveDialog(this);
    if (returnVal == 0) {
      java.io.File file = fc.getSelectedFile();
      try {
        PrintWriter out = new PrintWriter(new FileOutputStream(file));
        out.println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
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.