S
sushant_taneja
Hello All,
I am coding a text editor and want to save a file with the
extension .txt??
How can I acheive it???
My text editor uses the follwoing code for saving the contents of the
document area in the file:
public void saveFile()
{
if(this.isSaved())
{
try
{
String text = docArea.getText();
FileWriter out = new FileWriter(oFile);
BufferedWriter bufferout = new BufferedWriter(out);
bufferout.write(text, 0, text.length());
bufferout.close();
out.close();
}
catch(IOException ioe)
{
System.out.println(ioe.toString());
}
saved = true;
}
else
{
saved = true;
saveFileAs();
}
}
Please help me out.
Regards,
Sushant Taneja
I am coding a text editor and want to save a file with the
extension .txt??
How can I acheive it???
My text editor uses the follwoing code for saving the contents of the
document area in the file:
public void saveFile()
{
if(this.isSaved())
{
try
{
String text = docArea.getText();
FileWriter out = new FileWriter(oFile);
BufferedWriter bufferout = new BufferedWriter(out);
bufferout.write(text, 0, text.length());
bufferout.close();
out.close();
}
catch(IOException ioe)
{
System.out.println(ioe.toString());
}
saved = true;
}
else
{
saved = true;
saveFileAs();
}
}
Please help me out.
Regards,
Sushant Taneja