please help me find problem in the code below as it does not save file instead it tells that the system cannot find the file specified(There is no problem in program)...
public void file_saveAction()
{
JFileChooser filechooser_save = new JFileChooser();
int option = filechooser_save.showSaveDialog(frame);
if(option == JFileChooser.APPROVE_OPTION)
{
try
{
BufferedReader in = new BufferedReader(new FileReader("."));
BufferedWriter out =new BufferedWriter(new FileWriter(filechooser_save.getSelectedFile().getPath()));
int c=0;
c=in.read();
while(c!=-1)
{
out.write(c);
}
out.close();
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
}
public void file_saveAction()
{
JFileChooser filechooser_save = new JFileChooser();
int option = filechooser_save.showSaveDialog(frame);
if(option == JFileChooser.APPROVE_OPTION)
{
try
{
BufferedReader in = new BufferedReader(new FileReader("."));
BufferedWriter out =new BufferedWriter(new FileWriter(filechooser_save.getSelectedFile().getPath()));
int c=0;
c=in.read();
while(c!=-1)
{
out.write(c);
}
out.close();
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
}