Package javax.swing

Examples of javax.swing.JFileChooser.showSaveDialog()


    if (lastFolder != null)
    {
      fileChooser.setCurrentDirectory(lastFolder);
    }
   
    int retValue = fileChooser.showSaveDialog(this);
    if (retValue == JFileChooser.APPROVE_OPTION)
    {
      FileFilter fileFilter = fileChooser.getFileFilter();
      File file = fileChooser.getSelectedFile();
     
View Full Code Here


  }


  private void saveMenuAction(java.awt.event.ActionEvent evt) {
    JFileChooser chooser = new JFileChooser();
    int returnVal = chooser.showSaveDialog(this);
    if(returnVal == JFileChooser.APPROVE_OPTION) {
      try {
        memoToFile(chooser.getSelectedFile());
      }
      catch (Exception e) { showException(this,e); }
View Full Code Here

        fileChooser.setFileHidingEnabled(true);
        fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
        // TODO Language
        fileChooser.setDialogTitle("Choose file");
        fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        int selection = fileChooser.showSaveDialog(parent);
        if (selection == JFileChooser.APPROVE_OPTION) {
            result = fileChooser.getSelectedFile();
        }
        return result;
    }
View Full Code Here

  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

          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

            }
        }
       
        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

  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

            }
        };

        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

            // (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

            // (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

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.