Update MainFrame.java

Add save function