Make two changes
First - writing
In save.addActionListener
you close your Printwriter with fw.close();
. The Printerwriter is used by your BufferedWriter bw = new BufferedWriter(fw);
.
You have to call bw.close()
instead of fw.close()
Second - reading
The choice of your Layout is not the best. Your JTextArea is much to large. Your file is loaded but you can't see it. If you use final JTextArea print = new JTextArea(30, 30);
instead of final JTextArea print = new JTextArea(500, 500);
everythings works fine. Remember: The parameters in JTextArea are rows and columns - not pixel.
Hope that helps