My program has the following code where output
is a StringBuilder:
try
{
BufferedWriter bw = new BufferedWriter(new FileWriter("data.txt"));
bw.write(output.toString());
}
catch(IOException e)
{
System.out.println("File error: "+e.getMessage());
}
after the bw.write(output.toString());
I want to have another line that launches the textfile with the default application. I considered using the desktop API but heard it has bad cross-platform compatibility. Any suggestions?