private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed

        String agcoopCompany = "maininterface.ViewCompany";
        String agcoopMember = "maininterface.ViewMember";
        String agcoopSupplier = "maininterface.ViewSupplier";
        String agcoopNonMember = "maininterface.ViewNonMember";
        String agcoopLoan = "maininterface.ViewLoan";
        String agcoopReceipt = "maininterface.ViewReceipt";
        String agcoopGoods = "maininterface.ViewPurchGoods";
        String agcoopCashloan = "maininterface.ViewCashloan";
        
        try{
            if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopCompany))
            { 
                aC.reset();
                aC.passThrough();
                aC.setVisible(true);
                aC.setLocationRelativeTo(null);
                aC.setTitle("Add Company - Information");
                aC.setResizable(false);  
            }
        
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopMember))
            {
                aM.reset();
                aM.passThrough();
                aM.setVisible(true);
                aM.setLocationRelativeTo(null);
                aM.setTitle("Add Member - Information");
                aM.setResizable(false);
            }
        
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopSupplier))
            {
                aS.reset();
                aS.passThrough();
                aS.setVisible(true);
                aS.setLocationRelativeTo(null);
                aS.setTitle("Add Supplier - Information");
                aS.setResizable(false);
                
            }
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopNonMember))
            {
                aNM.reset();
                aNM.setVisible(true);
                aNM.passThrough();
                aNM.setLocationRelativeTo(null);
                aNM.setTitle("Add Non-Member - Information");
                aNM.setResizable(false);
            }
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopReceipt))
            {
                AddReceipt aR = new AddReceipt();
                aR.setVisible(true);
                aR.setLocationRelativeTo(null);
                aR.setTitle("Add Receipt - Information");
                aR.setResizable(false);
                
            }
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopLoan))
            {
                vL.addLoan();
            }
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopGoods))
            {
                System.out.println("he");
                aP.reset();
                aP.setVisible(true);
                aP.setLocationRelativeTo(null);
                aP.setResizable(false);
                aP.setTitle("Purchase Goods - Information");
            }
            else if(viewTab.getSelectedComponent().getClass().getName().equals(agcoopCashloan))
            {
                vCL.addLoan();
            }
            else
                System.out.println(viewTab.getSelectedComponent().getClass().getName());
        }
        catch(Exception e)
        {
            JOptionPane.showMessageDialog(null, "Error: Add tab to select where to add", "Error - Adding information", JOptionPane.ERROR_MESSAGE); 
        }
        
    }//GEN-LAST:event_buttonSaveActionPerformed