I have a swing application. As long as the application runs I manipulate the within class. But when user EXITS_ON_ClOSE , I have to save the data in a file How do I save it. Here is my current implementation
public static void main (String args[]) throws NumberFormatException, IOException{
displayCalendar p;
Saver save = new Saver();
p = new displayCalendar(save);
JFrame fr = new JFrame();
fr.add(p);
fr.setDefaultCloseOperation(EXIT_ON_CLOSE);
fr.setSize(500,500);
fr.setVisible(true);
save.saveAll();
}
That is I am trying to save before exiting main. But I can't get to that function at all. How do I save it?