⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formbean.java

📁 A brew application taking backup of the device
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package test;import java.util.Hashtable;/** * * @author Work IS Passion */public class FormBean {    private String firstName;    private String lastName;    private String email;    private String contact;        private Hashtable errors;    public FormBean(){        firstName = "";        lastName = "";        email = "";        contact = "";               errors = new Hashtable();    }    public boolean validate(){        boolean bool = true;        if(firstName.equals("")){            errors.put("firstName", "Please Enter your First Name");            firstName = "";            bool = false;        }        if(lastName.equals("")){            errors.put("lastName", "Please Enter your Last Name");            lastName="";            bool = false;        }        if(email.equals("")||(email.indexOf('@')==-1)){            errors.put("email", "Please Enter a valid email address");            email = "";            bool = false;        }        if(contact.equals("")){            errors.put("contact", "Please Enter your contact");            contact = "";            bool = false;        }        return bool;    }    public String getErrorMsg(String s){        String errorMsg = (String) errors.get(s.trim());        return (errorMsg==null)? "":errorMsg;    }    public void setError(String key, String msg){        errors.put(key, msg);    }    /**     * @return the firstName     */    public String getFirstName() {        return firstName;    }    /**     * @param firstName the firstName to set     */    public void setFirstName(String firstName) {        this.firstName = firstName;    }    /**     * @return the lastName     */    public String getLastName() {        return lastName;    }    /**     * @param lastName the lastName to set     */    public void setLastName(String lastName) {        this.lastName = lastName;    }    /**     * @return the email     */    public String getEmail() {        return email;    }    /**     * @param email the email to set     */    public void setEmail(String email) {        this.email = email;    }    /**     * @return the contact     */    public String getContact() {        return contact;    }    /**     * @param contact the contact to set     */    public void setContact(String contact) {        this.contact = contact;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -