Java Code Examples for javax.swing.JFileChooser.setSelectedFile()

The following are Jave code examples for showing how to use setSelectedFile() of the javax.swing.JFileChooser class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: RoboxSlicerExtension   File: ControlWindow.java   Source Code and License Vote up 6 votes
private void invokeFileSelector(JTextField path) {
    File f = new File(path.getText());

    while (f != null && f.toPath() != null && f.toPath().getNameCount() > 0 && !f.exists()) {
        f = f.getParentFile();
    }

    JFileChooser fc = new JFileChooser();

    if (f != null) {
        fc.setSelectedFile(f);
    }
    fc.setFileSelectionMode(JFileChooser.FILES_ONLY);

    int res = fc.showOpenDialog(this);
    if (res == JFileChooser.APPROVE_OPTION) {
        File file = fc.getSelectedFile();

        path.setText(file.getAbsolutePath());
    }
}
 
Example 2
Project: Logisim   File: MemMenu.java   Source Code and License Vote up 6 votes
private void doSave() {
	MemState s = factory.getState(instance, circState);

	JFileChooser chooser = proj.createChooser();
	File oldSelected = factory.getCurrentImage(instance);
	if (oldSelected != null)
		chooser.setSelectedFile(oldSelected);
	chooser.setDialogTitle(Strings.get("ramSaveDialogTitle"));
	int choice = chooser.showSaveDialog(frame);
	if (choice == JFileChooser.APPROVE_OPTION) {
		File f = chooser.getSelectedFile();
		try {
			HexFile.save(f, s.getContents());
			factory.setCurrentImage(instance, f);
		} catch (IOException e) {
			JOptionPane.showMessageDialog(frame, e.getMessage(), Strings.get("ramSaveErrorTitle"),
					JOptionPane.ERROR_MESSAGE);
		}
	}
}
 
Example 3
Project: incubator-netbeans   File: PanelProjectLocationExtSrc.java   Source Code and License Vote up 6 votes
private void browseProjectLocation(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseProjectLocation
    // TODO add your handling code here:
    JFileChooser chooser = new JFileChooser();
    chooser.setDialogTitle(NbBundle.getMessage(PanelSourceFolders.class, "LBL_NWP1_SelectProjectLocation")); // NOI18N
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    String path = this.projectLocation.getText();
    if (path.length() > 0) {
        File f = new File(path);
        File owner = f.getParentFile();
        if (owner.exists()) {
            chooser.setCurrentDirectory(owner);
        }
        if (f.exists()) {
            chooser.setSelectedFile(f);
        }
    }
    if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
        File file = chooser.getSelectedFile();
        if (file != null) {
            this.projectLocation.setText(FileUtil.normalizeFile(file).getAbsolutePath());
        }
    }
}
 
Example 4
Project: geomapapp   File: PDB.java   Source Code and License Vote up 6 votes
protected void saveAsASCII(Iterator it) {
	JFileChooser jfc = new JFileChooser(System.getProperty("user.home"));
	File f = new File("PDB_Export.txt");
	jfc.setSelectedFile(f);
	do {
		int c = jfc.showSaveDialog(null);
		if (c==jfc.CANCEL_OPTION||c==jfc.ERROR_OPTION) return;
		f = jfc.getSelectedFile();
		if (f.exists()) {
			c=JOptionPane.showConfirmDialog(null, "File Already Exists\nConfirm Overwrite");
			if (c==JOptionPane.OK_OPTION) break;
			if (c==JOptionPane.CANCEL_OPTION) return;
		}
	} while (f.exists());

	try {
		BufferedWriter out = new BufferedWriter(new FileWriter(f));
		for (; it.hasNext(); ) {
			out.write(it.next().toString());
			out.write("\n");
		}
		out.close();
	} catch (IOException ex){}
}
 
Example 5
Project: incubator-netbeans   File: TemplateSelector.java   Source Code and License Vote up 6 votes
private File selectFile(int dialogType, String approveButtonText) {
        JFileChooser fileChooser = new AccessibleJFileChooser(NbBundle.getMessage(TemplateSelector.class, "ACSD_SelectTemplate")/*, defaultDir*/);// NOI18N
        fileChooser.setDialogTitle(NbBundle.getMessage(TemplateSelector.class, "CTL_SelectTemplate"));// NOI18N
        fileChooser.setMultiSelectionEnabled(false);
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setDialogType(dialogType);

        File file = getTemplateFile();

//        if(file.isFile() && dialogType == JFileChooser.OPEN_DIALOG) {
//            fileChooser.setSelectedFile(file);
//        } else {
//            fileChooser.setCurrentDirectory(file.isFile() ? file.getParentFile() : file);
//        }
        if(file.isFile() ) {
            fileChooser.setSelectedFile(file);
        } else {
            fileChooser.setCurrentDirectory(file);
        }

        fileChooser.showDialog(getPanel(), approveButtonText);
        File f = fileChooser.getSelectedFile();
        return f;
    }
 
Example 6
Project: jaer   File: DavisDeepLearnCnnProcessor_HJ.java   Source Code and License Vote up 6 votes
/**
 * Loads a convolutional neural network (CNN) trained using DeapLearnToolbox
 * for Matlab (https://github.com/rasmusbergpalm/DeepLearnToolbox) that was
 * exported using Danny Neil's XML Matlab script cnntoxml.m.
 *
 */
synchronized public void doLoadApsDvsNetworkFromXML() {
    JFileChooser c = new JFileChooser(lastApsDvsNetXMLFilename);
    FileFilter filt = new FileNameExtensionFilter("XML File", "xml");
    c.addChoosableFileFilter(filt);
    c.setFileFilter(filt);
    c.setSelectedFile(new File(lastApsDvsNetXMLFilename));
    int ret = c.showOpenDialog(chip.getAeViewer());
    if (ret != JFileChooser.APPROVE_OPTION) {
        return;
    }
    lastApsDvsNetXMLFilename = c.getSelectedFile().toString();
    putString("lastAPSNetXMLFilename", lastApsDvsNetXMLFilename);
    try {
        apsDvsNet.loadFromXMLFile(c.getSelectedFile());
        dvsSubsampler = new DvsFramerSingleFrame(chip);
        dvsSubsampler.setFromNetwork(apsDvsNet);
    } catch (Exception ex) {
        Logger.getLogger(DavisDeepLearnCnnProcessor_HJ.class.getName()).log(Level.SEVERE, null, ex);
        JOptionPane.showMessageDialog(chip.getAeViewer().getFilterFrame(), "Couldn't load net from this file, caught exception " + ex + ". See console for logging.", "Bad network file", JOptionPane.WARNING_MESSAGE);
    }

}
 
Example 7
Project: Pogamut3   File: ExampleBotProjectPanelVisual.java   Source Code and License Vote up 6 votes
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
    String command = evt.getActionCommand();
    if ("BROWSE".equals(command)) {
        JFileChooser chooser = new JFileChooser();
        FileUtil.preventFileChooserSymlinkTraversal(chooser, null);
        chooser.setDialogTitle("Select Project Location");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        String path = this.projectLocationTextField.getText();
        if (path.length() > 0) {
            File f = new File(path);
            if (f.exists()) {
                chooser.setSelectedFile(f);
            }
        }
        if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
            File projectDir = chooser.getSelectedFile();
            projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
        }
        panel.fireChangeEvent();
    }

}
 
Example 8
Project: incubator-netbeans   File: RunJarPanel.java   Source Code and License Vote up 6 votes
private void btnWorkDirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnWorkDirActionPerformed
    JFileChooser chooser = new JFileChooser();
    chooser.setCurrentDirectory(null);
    chooser.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY);
    chooser.setMultiSelectionEnabled(false);
    
    String workDir = txtWorkDir.getText();
    if (workDir.equals("")) { //NOI18N
        workDir = FileUtil.toFile(project.getProjectDirectory()).getAbsolutePath();
    }
    chooser.setSelectedFile(new File(workDir));
    chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(RunJarPanel.class, "TIT_SelectWorkingDirectory"));
    if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { //NOI18N
        File file = FileUtil.normalizeFile(chooser.getSelectedFile());
        txtWorkDir.setText(file.getAbsolutePath());
    }
}
 
Example 9
Project: incubator-netbeans   File: ProjectProblemsProviders.java   Source Code and License Vote up 6 votes
@Override
@NonNull
@NbBundle.Messages({
    "LBL_BrokenLinksCustomizer_Resolve_File=Browse \"{0}\""
})
public Future<ProjectProblemsProvider.Result> resolve() {
    final JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    chooser.setDialogTitle(LBL_BrokenLinksCustomizer_Resolve_File(getDisplayId(type, id)));
    if (lastSelectedFile != null) {
        chooser.setSelectedFile(lastSelectedFile);
    }
    int option = chooser.showOpenDialog(null);
    if (option == JFileChooser.APPROVE_OPTION) {
        updateReference(chooser.getSelectedFile());
        lastSelectedFile = chooser.getSelectedFile();
        resolved = ProjectProblemsProvider.Status.RESOLVED;
    }
    return new Done(ProjectProblemsProvider.Result.create(resolved));
}
 
Example 10
Project: cuttlefish   File: ExportMenu.java   Source Code and License Vote up 6 votes
private void doExport(String name, String extension) {
	JFileChooser fc = new FileChooser();
	fc.setDialogTitle("Exporting cuttlefish network to " + name);
	fc.setSelectedFile(new File(getOutputName(extension)));
	fc.setFileFilter(new FileNameExtensionFilter(
			"." + extension + " files", extension));
	if (fc.showSaveDialog(networkPanel) == JFileChooser.APPROVE_OPTION) {

		try {
			Exporter exporter = NetworkExportController
					.getExporter(extension);
			NetworkExportController.export(networkPanel.getNetwork(),
					fc.getSelectedFile(), exporter);
		} catch (Exception ex) {
			errorPopup(ex, "Output error when saving in GraphML!");
		}
	}
}
 
Example 11
Project: rapidminer   File: FileChooserUI.java   Source Code and License Vote up 5 votes
@Override
public void actionPerformed(ActionEvent e) {
	if (UIManager.getBoolean("FileChooser.readOnly")) {
		return;
	}
	JFileChooser fc = getFileChooser();
	File currentDirectory = fc.getCurrentDirectory();
	FileSystemView fsv = fc.getFileSystemView();
	File newFolder = null;

	String name = SwingTools.showInputDialog("file_chooser.new_folder", "");

	try {
		if (name != null && !"".equals(name)) {
			newFolder = fsv.createNewFolder(currentDirectory);
			if (newFolder.renameTo(fsv.createFileObject(fsv.getParentDirectory(newFolder), name))) {
				newFolder = fsv.createFileObject(fsv.getParentDirectory(newFolder), name);
			} else {
				SwingTools.showVerySimpleErrorMessage("file_chooser.new_folder.rename", name);
			}
		}
	} catch (IOException exc) {
		SwingTools.showVerySimpleErrorMessage("file_chooser.new_folder.create", name);
		return;
	} catch (Exception exp) {
		// do nothing
	}

	if (fc.isMultiSelectionEnabled()) {
		fc.setSelectedFiles(new File[] { newFolder });
	} else {
		fc.setSelectedFile(newFolder);
	}

	fc.rescanCurrentDirectory();
}
 
Example 12
Project: incubator-netbeans   File: BasicProjectInfoPanel.java   Source Code and License Vote up 5 votes
private void browseProjectLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseProjectLocationActionPerformed
    JFileChooser chooser = new JFileChooser();
    FileUtil.preventFileChooserSymlinkTraversal(chooser, null);
    chooser.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY);
    if (projectLocation.getText().length() > 0 && getProjectLocation().exists()) {
        chooser.setSelectedFile(getProjectLocation());
    } else {
        chooser.setSelectedFile(ProjectChooser.getProjectsFolder());
    }
    chooser.setDialogTitle(NbBundle.getMessage(BasicProjectInfoPanel.class, "LBL_Browse_Location"));  //NOI18N
    if ( JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
        File projectLoc = FileUtil.normalizeFile(chooser.getSelectedFile());
        projectLocation.setText(projectLoc.getAbsolutePath());
    }
}
 
Example 13
Project: ramus   File: HTMLEditOptionPanel.java   Source Code and License Vote up 5 votes
protected void brows() {
    final JFileChooser chooser = getChooser();
    chooser.setSelectedFile(new File(jTextField.getText()));
    if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
        jTextField.setText(chooser.getSelectedFile().getAbsolutePath());
    }
}
 
Example 14
Project: JDigitalSimulator   File: Application.java   Source Code and License Vote up 5 votes
public void saveWorksheetAs(SimulationFrame frame) {
	if(frame==null)
		return;
	JFileChooser chooser = getFileChooser();
	chooser.setSelectedFile(new File(frame.getFileName()));
	if(chooser.showSaveDialog(Application.this)!=JFileChooser.APPROVE_OPTION)
		return;
	saveWorksheet(desktop.getSelectedFrame(), chooser.getSelectedFile());
}
 
Example 15
Project: incubator-netbeans   File: Selenium2Customizer.java   Source Code and License Vote up 5 votes
private void bUserExtensionFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bUserExtensionFileActionPerformed
    JFileChooser chooser = new JFileChooser();
    chooser.setAcceptAllFileFilterUsed(false);
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.setFileFilter(new FileNameExtensionFilter("Javascript File", "js"));
    chooser.setSelectedFile(new File(tfUserExtensionFile.getText().trim()));
    if (chooser.showOpenDialog(SwingUtilities.getWindowAncestor(this)) == JFileChooser.APPROVE_OPTION) {
        tfUserExtensionFile.setText(chooser.getSelectedFile().getAbsolutePath());
    }
}
 
Example 16
Project: geomapapp   File: Digitizer.java   Source Code and License Vote up 5 votes
void saveProfile(String fmt) {
	
	JFileChooser chooser = MapApp.getFileChooser();
	String defaultFileName = list.getSelectedValue().toString().replace(" ", "_") + "." + fmt;
	chooser.setSelectedFile(new File(defaultFileName));
	int ok = chooser.showSaveDialog(map.getTopLevelAncestor());
	if( ok==JFileChooser.CANCEL_OPTION ) return;
	File file = chooser.getSelectedFile();
	if( file.exists() ) {
		ok = askOverWrite();
		if( ok==JOptionPane.CANCEL_OPTION ) return;
	}

	//get the image from the graph
	BufferedImage image = graph.getFullImage();
	Graphics g = image.getGraphics();
	graph.paint(g);

	try {
		String name = file.getName();
		int sIndex = name.lastIndexOf(".");
		String suffix = sIndex<0
			? fmt
			: name.substring( sIndex+1 );
		if( !ImageIO.getImageWritersBySuffix(suffix).hasNext())suffix = fmt;

		if ( chooser.getSelectedFile().getPath().endsWith(fmt) ) {
			ImageIO.write(image, suffix, file);
		}
		else {
			ImageIO.write(image, suffix, new File(file.getPath() + fmt) );
		}

	} catch(IOException e) {
		JOptionPane.showMessageDialog(null,
				" Save failed: "+e.getMessage(),
				" Save failed",
				 JOptionPane.ERROR_MESSAGE);
	}
}
 
Example 17
Project: QN-ACTR-Release   File: CustomDialog.java   Source Code and License Vote up 4 votes
File saveFileDialog(File file) {
	FileFilter fFileFilter = new FileFilter() {
		@Override
		public boolean accept(File f) {
			return f.getName().toLowerCase().endsWith(".csv") || f.isDirectory();
		}

		@Override
		public String getDescription() {
			return "Comma delimited (*.csv)";
		}
	};

	JFileChooser fc = new JFileChooser();

	// Start in current directory
	fc.setCurrentDirectory(file);

	// Set filter for Java source files.
	fc.setFileFilter(fFileFilter);

	// Set to a default name for save.
	fc.setSelectedFile(file);

	// Open chooser dialog
	int result = fc.showSaveDialog(this);

	if (result == JFileChooser.CANCEL_OPTION) {
		return null;
	} else if (result == JFileChooser.APPROVE_OPTION) {
		file = fc.getSelectedFile();
		if (file.exists()) {
			int response = JOptionPane.showConfirmDialog(null, "Overwrite existing file?", "Confirm Overwrite", JOptionPane.OK_CANCEL_OPTION,
					JOptionPane.QUESTION_MESSAGE);
			if (response == JOptionPane.CANCEL_OPTION) {
				return null;
			}
		}
		return file;
	} else {
		return null;
	}
}
 
Example 18
Project: MapAnalyst   File: FileUtils.java   Source Code and License Vote up 4 votes
/**
 * Ask the user for a file using the Swing JFileChooser. On macOS,
 * JFileChooser is poorly implemented, and therefore the AWT FileDialog
 * should be used on macOS.
 */
private static String askSwingFile(java.awt.Frame frame, String message,
        String defaultFile, FileNameExtensionFilter filter, boolean load) {

    // load the directory last visited from the preferences
    String LAST_USED_DIRECTORY = "last_directory";
    Preferences prefs = Preferences.userRoot().node(FileUtils.class.getName());
    String lastDir = prefs.get(LAST_USED_DIRECTORY, new File(".").getAbsolutePath());

    JFileChooser fc = new JFileChooser(lastDir);
    if (filter != null) {
        fc.setFileFilter(filter);
    }
    fc.setDialogTitle(message);
    File selFile;
    // set default file
    try {
        File f = new File(new File(defaultFile).getCanonicalPath());
        fc.setSelectedFile(f);
    } catch (Exception e) {
    }

    int result;
    do {
        if (load) {
            // Show open dialog
            result = fc.showOpenDialog(frame);
        } else {
            // Show save dialog
            result = fc.showSaveDialog(frame);
        }

        if (result != JFileChooser.APPROVE_OPTION) {
            return null;
        }

        selFile = fc.getSelectedFile();
        if (selFile == null) {
            return null;
        }

        // store directory in preferences
        prefs.put(LAST_USED_DIRECTORY, selFile.getParent());

    } while (!load && !askOverwrite(selFile, fc));

    return selFile.getPath();
}
 
Example 19
Project: geomapapp   File: UnknownDataSet.java   Source Code and License Vote up 4 votes
public void exportExcelXLSX(String saveOption){
	//run standard checks before exporting
	if (!exportChecks(saveOption)) return;

	JFileChooser jfc = new JFileChooser(System.getProperty("user.home"));
	ExcelFileFilter eff = new ExcelFileFilter();
	jfc.setFileFilter(eff);
	String defaultName = desc.name.replace(":", "") + ".xlsx";

	if(defaultName.contains("Data Table ")){
		defaultName = defaultName.replace("Data Table ", "");
	}

	File f=new File(defaultName);
	jfc.setSelectedFile(f);
	do {
		int c = jfc.showSaveDialog(null);
		if (c==JFileChooser.CANCEL_OPTION||c==JFileChooser.ERROR_OPTION) return;
		f = jfc.getSelectedFile();
		if (f.exists()) {
			c=JOptionPane.showConfirmDialog(null, "File Already Exists\nConfirm Overwrite");
			if (c==JOptionPane.OK_OPTION)break;
			if (c==JOptionPane.CANCEL_OPTION) return;
		}
	} while (f.exists());

	try {
		if (!f.getName().endsWith(".xlsx")){
			System.out.println(f.getName());
			JOptionPane.showMessageDialog(null, "Save did not complete. Must end in .xlsx. Try again.");
		}else{
			XSSFWorkbook xlsxWB = new XSSFWorkbook();
			CreationHelper createHelper = xlsxWB.getCreationHelper();
			XSSFSheet xlsxSheet1 = xlsxWB.createSheet("First Sheet");
			Row row = null;
			
			int[] ind;
			if (saveOption.equals("selection")) {
				ind = dataT.getSelectedRows();
			} else if (saveOption.equals("plottable")) {
				ind = getPlottableRows();
			} else {
				ind = new int[dataT.getRowCount()];
				for (int i=0; i<dataT.getRowCount(); i++) ind[i] = i;
			}
			int xlsxCol = dataT.getColumnCount();
			row = xlsxSheet1.createRow((0));
			//don't include Plot column
			for (int c=1; c<xlsxCol; c++){
				String columnName = dataT.getColumnName(c);
				row.createCell(c-1).setCellValue(columnName);
			}

			for (int r=1; r<=ind.length; r++){
				row = xlsxSheet1.createRow((r));
				for (int c=1; c<xlsxCol; c++){
					Object o = dataT.getValueAt(ind[r-1], c);
					String input1 = null;
					if(o instanceof String && ((String)o).equals("NaN")){
						o = "";
						input1 = o.toString();
						row.createCell(c-1).setCellValue(input1);
					}else if(o instanceof String){
						row.createCell(c-1).setCellValue((String)o);
					}
				}
			}
			FileOutputStream xlsxOut = new FileOutputStream(f);
			xlsxWB.write(xlsxOut);
			xlsxOut.close();
		}
	} catch (Exception ex){
		ex.printStackTrace();
	}
}
 
Example 20
Project: HBaseClient   File: ExportActionListener.java   Source Code and License Vote up 4 votes
@Override
public void onClick(ActionEvent arg0)
{
    if ( JavaHelp.isNull(this.getAppFrame().getTableName()) )
    {
        this.getAppFrame().showHintInfo("请先选择要导出的表" ,Color.BLUE);
        return;
    }
    
    if ( this.getAppFrame().getRowCount() == 0 )
    {
        this.getAppFrame().showHintInfo("查询结果无数据,无法导出" ,Color.BLUE);
        return;
    }
    
    
    JTable        v_JTable      = (JTable)XJava.getObject("xtDataList");
    int []        v_RowIndexArr = v_JTable.getSelectedRows();
    StringBuilder v_FileName    = new StringBuilder();
    
    // 生成文件名称
    v_FileName.append(this.getTableName());
    if ( v_RowIndexArr.length <= 0 )
    {
        String v_Text = "";
        
        v_Text = ((JTextComponent)XJava.getObject("RowKey"))     .getText();
        if ( !JavaHelp.isNull(v_Text) )
        {
            v_FileName.append("_R.").append(v_Text.trim());
        }
        
        v_Text = ((JComboBox)     XJava.getObject("FamilyName")) .getSelectedItem().toString();
        if ( !JavaHelp.isNull(v_Text) ) 
        {
            v_FileName.append("_F.").append(v_Text.trim());
        }
        
        v_Text = ((JComboBox)     XJava.getObject("ColumnName")) .getSelectedItem().toString();
        if ( !JavaHelp.isNull(v_Text) ) 
        {
            v_FileName.append("_C.").append(v_Text.trim());
        }
        
        v_Text = ((JTextComponent)XJava.getObject("ColumnValue")).getText();
        if ( !JavaHelp.isNull(v_Text) ) 
        {
            v_FileName.append("_V.").append(v_Text.trim());
        }
    }
    else
    {
        v_FileName.append("_CCount.").append(v_RowIndexArr.length);
        v_FileName.append("_").append(Date.getNowTime().getFull_ID());
    }
    v_FileName.append(".txt");
    
    
    
    File         v_SaveFile    = new File(v_FileName.toString());
    JFileChooser v_FileChooser = new JFileChooser();
    v_FileChooser.setSelectedFile(v_SaveFile);
    
    int v_Result = v_FileChooser.showSaveDialog(this.getAppFrame());
    if ( v_Result == JFileChooser.APPROVE_OPTION )
    {
        v_SaveFile = v_FileChooser.getSelectedFile();
        
        this.writeContents(v_JTable ,v_RowIndexArr ,v_SaveFile);
    }
}