public Accounting() throws IOException {
        logPath = "account.txt";
        
        try {
            logWriter = new WriteFile(logPath, true);
            logFile = new ReadFile(logPath);
            logFileText = logFile.OpenFile();
           
            if(logFile.readLastLine().isEmpty()){
                balance = BigDecimal.ZERO;
                balance = balance.setScale(2, RoundingMode.FLOOR);
                logWriter.writeToFile("The balance is:");
                logWriter.writeToFile(balance.toString());
            }
            else{
                balance = new BigDecimal(logFile.readLastLine());
                balance = balance.setScale(2, RoundingMode.FLOOR);
            }
            
        }
        catch (IOException | ArrayIndexOutOfBoundsException e){
           balance = BigDecimal.ZERO;
           balance = balance.setScale(2, RoundingMode.FLOOR);
           logWriter.writeToFile("The balance is:");
           logWriter.writeToFile(balance.toString());
        }
        initComponents();
        balanceField.setText("$"+balance.toString());
    }