import java.io.*;
import javax.swing.*;
 
class H13Ex6
{
     public static void main (String args[]) throws IOException
     {
           File f=new File("datafile.dat");
           JFileChooser dosyasec=new JFileChooser();
           int onay = dosyasec.showSaveDialog(null);
           if(onay==JFileChooser.APPROVE_OPTION) {f=dosyasec.getSelectedFile();}             
	       BufferedWriter fout=new BufferedWriter(new FileWriter(f));
           String a="Turhan";
           double x=12.325;
           fout.write(a+" "+x);
           fout.close();
           System.out.println("Dosya ismi:"+f.getName());
           BufferedReader fin=new BufferedReader(new FileReader(f));
           String b=fin.readLine();
           System.out.println("b="+b);
     }
}
