mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-01-11 04:29:45 +00:00
FileChooser
This commit is contained in:
parent
40090db4e7
commit
a7ef714943
@ -4,6 +4,7 @@ import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.JTable;
|
||||
|
||||
public class CSVFileWriter
|
||||
@ -15,9 +16,19 @@ public class CSVFileWriter
|
||||
|
||||
FileWriter writer;
|
||||
|
||||
JFileChooser fileChooser = new JFileChooser ();
|
||||
// fileChooser.setCurrentDirectory (new File (csvFile));
|
||||
fileChooser.setSelectedFile (new File (csvFile));
|
||||
int returnValue = fileChooser.showSaveDialog (null);
|
||||
if (returnValue != JFileChooser.APPROVE_OPTION)
|
||||
return;
|
||||
|
||||
File selectedFile = fileChooser.getSelectedFile ();
|
||||
System.out.println (selectedFile.getName ());
|
||||
|
||||
try
|
||||
{
|
||||
writer = new FileWriter (csvFile);
|
||||
writer = new FileWriter (selectedFile);
|
||||
writer.append (String
|
||||
.format ("Path,Name,Type,Size,Duplicate Name, Duplicate Data, Checksum%n"));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user