Package IO

Examples of IO.SaveObject


        } catch (NoSuchAlgorithmException ex) {
            Logger.getLogger(Keep_It_Safe.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IllegalBlockSizeException ex) {
            Logger.getLogger(Keep_It_Safe.class.getName()).log(Level.SEVERE, null, ex);
        }
        SaveObject save=null;
        /*
        this.read=new OpenObject();
        if(this.read.openfile()){
            this.accounts=this.read.getAccounts();
        }
         * */
        boolean flag=false;
        String pass;
        pass=encrypt_md5(getUI_create_account().getjPasswordField2())//flag pass again
        if (account.get_password().equals(pass)){
            for (int i=0;i<Keep_It_Safe.accounts.size();i++){
                if((Keep_It_Safe.accounts.get(i).get_name()).equals(account.get_name())){
                   flag=true;
                   break;
                }
            }
            if (flag){
                this.output=printalreadyexists();
            }
            else{
                save=new SaveObject();
                Keep_It_Safe.accounts.add(account);
                this.output=printpasswordcorrect();
                this.output2=save.saveFile(Keep_It_Safe.accounts);
            }
        }
        else{
           this.output=printpasswordincorrect();
        }
View Full Code Here


        }

    }
    public void delete_account (Frame_Main aux){
        Keep_It_Safe.read=new OpenObject(getUI_login().getjTextField1());
        SaveObject save=new SaveObject();
        boolean flag=false;
        Account account=new Account();
        String pass;
        if(Keep_It_Safe.read.openfile()){
            pass=encrypt_md5(getUI_login().getjPasswordField1());
            for(int i=0;i<Keep_It_Safe.accounts.size();i++){
                account = (((Account) (Keep_It_Safe.accounts.get(i))));
                if ((account.get_name()).equals(getUI_login().getjTextField1())){
                    flag=true;
                    break;
                }
                else{
                    this.output=printuserincorrect();

                }

            }
            if (account.password.equals(pass) && flag==true){
                //this.output=printUserInfo(account);
                for(int i=0;i<Keep_It_Safe.accounts.size();i++){
                    account = (((Account) (Keep_It_Safe.accounts.get(i))));
                    if ((account.get_name()).equals(getUI_login().getjTextField1())){
                     Keep_It_Safe.accounts.remove(i);
                     this.output="User Successfully Removed";
                     this.output2=save.saveFile(Keep_It_Safe.accounts);
                     break;
                    }
                    else{
                        this.output=printuserincorrect();
                    }
View Full Code Here

TOP

Related Classes of IO.SaveObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.