@@ -0,0 +1,3479 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage retirementcalculator;%0A%0Aimport java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.ObjectOutputStream;%0Aimport java.io.Serializable;%0Aimport java.nio.charset.Charset;%0A%0A/**%0A *%0A * @author derekbarrera%0A */%0Apublic class Save implements Serializable %7B%0A    %0A    int    retirementAgeField, ageField;%0A    double incomeTaxRateField, capGainsTxRateField, preTaxBalanceField, postTaxBalanceField, %0A           preTaxContField, postTaxContField, rateOfReturnField;%0A    %0A    public Save(int ageField, double incomeTaxRateField, int retirementAgeField, %0A                      double capGainsTxRateField, double preTaxBalanceField, double postTaxBalanceField, double preTaxContField, %0A                      double postTaxContField, double rateOfReturnField, File file)%7B%0A        %0A        this.ageField = ageField;%0A        this.incomeTaxRateField = incomeTaxRateField;%0A        this.retirementAgeField = retirementAgeField;%0A        this.capGainsTxRateField = capGainsTxRateField;%0A        this.preTaxBalanceField = preTaxBalanceField;%0A        this.postTaxBalanceField = postTaxBalanceField;%0A        this.preTaxContField = preTaxContField;%0A        this.postTaxContField = postTaxContField;%0A        this.rateOfReturnField = rateOfReturnField - 1.0;%0A        %0A        saveSerializer(file);%0A  %0A    %7D%0A    %0A    public Save(int ageField, double incomeTaxRateField, int retirementAgeField, %0A                      double capGainsTxRateField, double preTaxBalanceField, double postTaxBalanceField, double preTaxContField, %0A                      double postTaxContField, double rateOfReturnField)%7B%0A        %0A        this.ageField = ageField;%0A        this.incomeTaxRateField = incomeTaxRateField;%0A        this.retirementAgeField = retirementAgeField;%0A        this.capGainsTxRateField = capGainsTxRateField;%0A        this.preTaxBalanceField = preTaxBalanceField;%0A        this.postTaxBalanceField = postTaxBalanceField;%0A        this.preTaxContField = preTaxContField;%0A        this.postTaxContField = postTaxContField;%0A        this.rateOfReturnField = rateOfReturnField - 1.0;%0A  %0A    %7D%0A    %0A    public void saveSerializer(File file)%7B%0A        %0A        Charset chars = Charset.forName(%22US-ASCII%22);%0A    %0A        String filePath = file.toPath().toString();%0A        System.out.println(filePath);%0A        Save savers;%0A        %0A            if (file != null) %7B        %0A            %0A                try %7B%0A                    %0A                    FileOutputStream fileOut =%0A                    new FileOutputStream(filePath);%0A                    ObjectOutputStream out = new ObjectOutputStream(fileOut);%0A                    out.writeObject(%0A                            %0A                        savers = new Save(ageField, incomeTaxRateField, retirementAgeField, %0A                                         capGainsTxRateField, preTaxBalanceField, postTaxBalanceField, preTaxContField, %0A                                         postTaxContField, rateOfReturnField)%0A                    );%0A                    out.close();%0A                    fileOut.close();%0A                    System.out.printf(%22Serialized data is saved in%22 + filePath);%0A            %0A                %7D catch (IOException e) %7B%0A                    System.out.println(e.getMessage());%0A                %7D%0A            %7D       %0A    %7D%0A    %0A%7D%0A

Save class to save a serialized copy of all the textFields