Results 1 to 6 of 6
  1. #1
    javadroid13's Avatar
    javadroid13 is offline Member
    Join Date
    Dec 2011
    Posts
    7
    Rep Power
    0

    Default HELP - MovementForm

    Masters! can somebody help me with my problem a Null pointer Exception problem again...
    I already instantiate the object but still I got this error, please see attach.
    HELP - MovementForm-movementform.jpg

    And here are some of my codes...

    Information.java
    Java Code:
    package com.adb.bom;
    
    import java.util.ArrayList;
    import java.util.Date;
    
    
    public class Information {
        
        private ArrayList<ActionTaken> actionTakens;
        private int transactionNo;
        private String deptFrom;
        private String deptTo;
        private String equipFrom;
        private String equipTo;
        private String configIdFrom;
        private String configIdTo;
        private String locationFrom;
        private String locationTo;
        private String accntFrom;
        private String accntTo;
        private String nbsFrom;
        private String nbsTo;
        private String reason;
        private String jobCompletedBy;
        private String userAcceptance;
        private Date date;
    
        public Information() {
            this.actionTakens = new ArrayList<ActionTaken>();
            this.deptFrom = deptFrom;
            this.deptTo = deptTo;
            this.equipFrom = equipFrom;
            this.equipTo = equipTo;
            this.configIdFrom = configIdFrom;
            this.configIdTo = configIdTo;
            this.locationFrom = locationFrom;
            this.locationTo = locationTo;
            this.accntFrom = accntFrom;
            this.accntTo = accntTo;
            this.nbsFrom = nbsFrom;
            this.nbsTo = nbsTo;
            this.reason = reason;
            this.jobCompletedBy = jobCompletedBy;
            this.userAcceptance = userAcceptance;
            this.date = date;
        }
    
        public Information(String deptFrom, String deptTo, String equipFrom, String equipTo, String configIdFrom, String configIdTo, String locationFrom, String locationTo, String accntFrom, String accntTo, String nbsFrom, String nbsTo, String reason) {
            this.deptFrom = deptFrom;
            this.deptTo = deptTo;
            this.equipFrom = equipFrom;
            this.equipTo = equipTo;
            this.configIdFrom = configIdFrom;
            this.configIdTo = configIdTo;
            this.locationFrom = locationFrom;
            this.locationTo = locationTo;
            this.accntFrom = accntFrom;
            this.accntTo = accntTo;
            this.nbsFrom = nbsFrom;
            this.nbsTo = nbsTo;
            this.reason = reason;
        }
    
        public Information(ArrayList<ActionTaken> actionTakens, int transactionNo, String deptFrom, String deptTo, String equipFrom, String equipTo, String configIdFrom, String configIdTo, String locationFrom, String locationTo, String accntFrom, String accntTo, String nbsFrom, String nbsTo, String reason, String jobCompletedBy, String userAcceptance, Date date) {
            this.actionTakens = actionTakens;
            this.transactionNo = transactionNo;
            this.deptFrom = deptFrom;
            this.deptTo = deptTo;
            this.equipFrom = equipFrom;
            this.equipTo = equipTo;
            this.configIdFrom = configIdFrom;
            this.configIdTo = configIdTo;
            this.locationFrom = locationFrom;
            this.locationTo = locationTo;
            this.accntFrom = accntFrom;
            this.accntTo = accntTo;
            this.nbsFrom = nbsFrom;
            this.nbsTo = nbsTo;
            this.reason = reason;
            this.jobCompletedBy = jobCompletedBy;
            this.userAcceptance = userAcceptance;
            this.date = date;
        }
        
        public Information(int transactionNo) {
            this();
            this.setTransactionNo(transactionNo + 1);
        }
    
        public String getAccntFrom() {
            return accntFrom;
        }
    
        public void setAccntFrom(String accntFrom) {
            this.accntFrom = accntFrom;
        }
    
        public String getAccntTo() {
            return accntTo;
        }
    
        public void setAccntTo(String accntTo) {
            this.accntTo = accntTo;
        }
    
        public String getConfigIdFrom() {
            return configIdFrom;
        }
    
        public void setConfigIdFrom(String configIdFrom) {
            this.configIdFrom = configIdFrom;
        }
    
        public String getConfigIdTo() {
            return configIdTo;
        }
    
        public void setConfigIdTo(String configIdTo) {
            this.configIdTo = configIdTo;
        }
    
        public String getDeptFrom() {
            return deptFrom;
        }
    
        public void setDeptFrom(String deptFrom) {
            this.deptFrom = deptFrom;
        }
    
        public String getDeptTo() {
            return deptTo;
        }
    
        public void setDeptTo(String deptTo) {
            this.deptTo = deptTo;
        }
    
        public String getEquipFrom() {
            return equipFrom;
        }
    
        public void setEquipFrom(String equipFrom) {
            this.equipFrom = equipFrom;
        }
    
        public String getEquipTo() {
            return equipTo;
        }
    
        public void setEquipTo(String equipTo) {
            this.equipTo = equipTo;
        }
    
        public String getLocationFrom() {
            return locationFrom;
        }
    
        public void setLocationFrom(String locationFrom) {
            this.locationFrom = locationFrom;
        }
    
        public String getLocationTo() {
            return locationTo;
        }
    
        public void setLocationTo(String locationTo) {
            this.locationTo = locationTo;
        }
    
        public String getNbsFrom() {
            return nbsFrom;
        }
    
        public void setNbsFrom(String nbsFrom) {
            this.nbsFrom = nbsFrom;
        }
    
        public String getNbsTo() {
            return nbsTo;
        }
    
        public void setNbsTo(String nbsTo) {
            this.nbsTo = nbsTo;
        }
    
        public String getReason() {
            return reason;
        }
    
        public void setReason(String reason) {
            this.reason = reason;
        }
    
        public int getTransactionNo() {
            return transactionNo;
        }
    
        public void setTransactionNo(int transactionNo) {
            this.transactionNo = transactionNo;
        }
    
        public ArrayList<ActionTaken> getActionTakens() {
            return actionTakens;
        }
    
        public void setActionTakens(ArrayList<ActionTaken> actionTakens) {
            this.actionTakens = actionTakens;
        }
    
        public Date getDate() {
            return date;
        }
    
        public void setDate(Date date) {
            this.date = date;
        }
    
        public String getJobCompletedBy() {
            return jobCompletedBy;
        }
    
        public void setJobCompletedBy(String jobCompletedBy) {
            this.jobCompletedBy = jobCompletedBy;
        }
    
        public String getUserAcceptance() {
            return userAcceptance;
        }
    
        public void setUserAcceptance(String userAcceptance) {
            this.userAcceptance = userAcceptance;
        }
    
        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Information other = (Information) obj;
            if (this.transactionNo != other.transactionNo) {
                return false;
            }
            return true;
        }
    
        @Override
        public int hashCode() {
            int hash = 7;
            hash = 89 * hash + this.transactionNo;
            return hash;
        }
    
        @Override
        public String toString() {
            return "Information{" + "actionTakens=" + actionTakens + ", transactionNo=" + transactionNo + ", deptFrom=" + deptFrom + ", deptTo=" + deptTo + ", equipFrom=" + equipFrom + ", equipTo=" + equipTo + ", configIdFrom=" + configIdFrom + ", configIdTo=" + configIdTo + ", locationFrom=" + locationFrom + ", locationTo=" + locationTo + ", accntFrom=" + accntFrom + ", accntTo=" + accntTo + ", nbsFrom=" + nbsFrom + ", nbsTo=" + nbsTo + ", reason=" + reason + ", jobCompletedBy=" + jobCompletedBy + ", userAcceptance=" + userAcceptance + ", date=" + date + '}';
        }    
        
        public ActionTaken searchAction(ActionTaken actionTaken) {
            int index = this.actionTakens.indexOf(actionTaken);
            if(index != -1) {
                return this.actionTakens.get(index);
            }
            else {
                return null;
            }
        }
        
        public ActionTaken searchAction(int number) {
            ActionTaken actionTaken = new ActionTaken();
            actionTaken.setNumber(number);
            return this.searchAction(actionTaken);
        }
        
        public ActionTaken addAction(ActionTaken actionTaken) {
            if(this.searchAction(actionTaken) != null) {
                this.actionTakens.add(actionTaken);
                return actionTaken;
            }
            else {
                return null;
            }
        }
        
        public ActionTaken addAction(String description, String action, String serialNo, String propertyCtrlNo) {
            ActionTaken actionTaken = new ActionTaken(description, action, serialNo, propertyCtrlNo);
            return this.addAction(actionTaken);
        }
    }
    ActionTaken.java
    Java Code:
    package com.adb.bom;
    
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    
    
    public class ActionTaken {
        private int number;
        private String description;
        private String action;
        private String serialNo;
        private String propertyControlNo;
        private String loanDueDate;
        private int dueDate;
        private Date date;
    
        public ActionTaken() {
            this.description = description;
            this.action = action;
            this.serialNo = serialNo;
            this.propertyControlNo = propertyControlNo;
            this.loanDueDate = loanDueDate;
            this.dueDate = dueDate;
            this.setNumber(number + 1);
        }
    
        public ActionTaken(String description, String action, String serialNo, String propertyControlNo) {
            this.description = description;
            this.action = action;
            this.serialNo = serialNo;
            this.propertyControlNo = propertyControlNo;
        }
        
        public ActionTaken(int dueDate) {
            this();
            this.dueDate = 45;
            GregorianCalendar gc = new GregorianCalendar();
            gc.add(Calendar.DATE, 45);
            this.date = gc.getTime();
        }
        
        public String getAction() {
            if(this.action.equals("NI")) {
                this.action = "New Installation";
            }
            else if(this.action.equals("RP")) {
                this.action = "Replacement";
            }
            else if(this.action.equals("ML")) {
                this.action = "Mission Loan";
            }
            else if(this.action.equals("SA")) {
                this.action = "Special Allocation";
            }
            else if(this.action.equals("PD")) {
                this.action = "Pulled Out";
            }
            else if(this.action.equals("SL")) {
                this.action = "Short Term Loan";
            }
            else if(this.action.equals("RL")) {
                this.action = "Relocation";
            }
            else if(this.action.equals("PR")) {
                this.action = "Pulled Out - Returned to OIST";
            }
            else if(this.action.equals("LL")) {
                this.action = "Long Term";
            }
            else if(this.action.equals("TA")) {
                this.action = "Transfer Accountability";
            }
            else if(this.action.equals("RE")) {
                this.action = "Retain";
            }
            else if(this.action.equals("OT")) {
                this.action = "Others(please specify)";
            }
            return this.action;
        }
    
        public void setAction(String action) {
            this.action = action;
        }
    
        public Date getDate() {
            return date;
        }
    
        public void setDate(Date date) {
            this.date = date;
        }
    
        public String getDescription() {
            return description;
        }
    
        public void setDescription(String description) {
            this.description = description;
        }
    
        public String getPropertyControlNo() {
            return propertyControlNo;
        }
    
        public void setPropertyControlNo(String propertyControlNo) {
            this.propertyControlNo = propertyControlNo;
        }
    
        public String getSerialNo() {
            return serialNo;
        }
    
        public void setSerialNo(String serialNo) {
            this.serialNo = serialNo;
        }
    
        public int getDueDate() {
            return dueDate;
        }
    
        public void setDueDate(int dueDate) {
            this.dueDate = dueDate;
        }
    
        public String getLoanDueDate() {
            return loanDueDate;
        }
    
        public void setLoanDueDate(String loanDueDate) {
            this.loanDueDate = loanDueDate;
        }
    
        public int getNumber() {
            return number;
        }
    
        public void setNumber(int number) {
            this.number = number;
        }
    
        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final ActionTaken other = (ActionTaken) obj;
            if (this.number != other.number) {
                return false;
            }
            return true;
        }
    
        @Override
        public int hashCode() {
            int hash = 7;
            hash = 89 * hash + this.number;
            return hash;
        }
    
        @Override
        public String toString() {
            return "ActionTaken{" + "number=" + number + ", description=" + description + ", action=" + action + ", serialNo=" + serialNo + ", propertyControlNo=" + propertyControlNo + ", loanDueDate=" + loanDueDate + ", dueDate=" + dueDate + ", date=" + date + '}';
        }
    }
    ActionTable.java
    Java Code:
    package com.adb.gui;
    
    import com.adb.bom.ActionTaken;
    import java.text.DateFormat;
    import java.util.ArrayList;
    import java.util.Locale;
    import javax.swing.table.DefaultTableModel;
    
    
    public class ActionTable extends DefaultTableModel {
        
        private ArrayList<ActionTaken> actionTakens;
        private DateFormat df;
        
        public ActionTable(ArrayList<ActionTaken> actionTakens) {
            this.actionTakens = actionTakens;
            String columns[] = {"No.","Description","Action","Serial No.","Property Control No.","Loan Due Date"};
            this.setColumnIdentifiers(columns);
        }
        
        public int getRowCount() {
            int rows = 0;
            if(this.actionTakens != null && this.actionTakens.size() > 0) {
                rows = this.actionTakens.size();
            }
            return rows;
        }
        
        public int getColumnCount() {
            int columns = 6;
            return columns;
        }
        
        public Object getValueAt(int rowIndex, int columnIndex) {
            String str = "";
            ActionTaken actionTaken = null;
            df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.ENGLISH);
            if(this.actionTakens != null && this.actionTakens.size() > 0) {
                actionTaken = (ActionTaken)this.actionTakens.get(rowIndex);
                switch(columnIndex) {
                    case 0:
                        str =""+actionTaken.getNumber();
                        break;
                    case 1:
                        str = actionTaken.getDescription();
                        break;
                    case 2:
                        str = actionTaken.getAction();
                        break;
                    case 3:
                        str = actionTaken.getSerialNo();
                        break;
                    case 4:
                        str = actionTaken.getPropertyControlNo();
                        break;
                    case 5:
                        str = ""+df.format(actionTaken.getLoanDueDate());
                        break;
                }
            }
            return str;
        }
        
        public void setActionTakens(ArrayList<ActionTaken> actionTakens) {
            this.actionTakens = actionTakens;
        }
        
        public ArrayList<ActionTaken> getActionTakens() {
            return this.actionTakens;
        }
    }

  2. #2
    gauravfzd's Avatar
    gauravfzd is offline Member
    Join Date
    Oct 2010
    Location
    India
    Posts
    72
    Rep Power
    0

    Default Re: HELP - MovementForm

    check if the "this.information" and "myAt" variables contains null or not.......

  3. #3
    javadroid13's Avatar
    javadroid13 is offline Member
    Join Date
    Dec 2011
    Posts
    7
    Rep Power
    0

    Default Re: HELP - MovementForm

    Thanks sir for the advise. I will check "this.information"

  4. #4
    javadroid13's Avatar
    javadroid13 is offline Member
    Join Date
    Dec 2011
    Posts
    7
    Rep Power
    0

    Default Re: HELP - MovementForm

    Sir I still got the "Null-Pointer Exception" problem please check my code
    Java Code:
    package com.adb.gui;
    
    import com.adb.bom.ActionTaken;
    import com.adb.bom.Information;
    import com.adb.bom.Login;
    import java.text.DateFormat;
    import java.util.Locale;
    import javax.swing.JOptionPane;
    
    /**
     *
     * @author s85
     */
    public class MovementForm extends javax.swing.JFrame {
    
        private Login login;
        private Information information;
        private ActionTaken actionTaken;
        private DateFormat df;
        /**
         * Creates new form MovementForm
         */
        public MovementForm() {
            initComponents();
        }
        
        public MovementForm(Information information, ActionTaken actionTaken) {
            this();
            this.information = information;
            this.actionTaken = actionTaken;
        }
        
        public MovementForm(Information information) {
            this();
            this.information = information;
            this.txtDeptOfficeFrom.setText(this.information.getDeptFrom());
            this.txtDeptOfficeTo.setText(this.information.getDeptTo());
            this.txtEquipTypeModFrom.setText(this.information.getEquipFrom());
            this.txtEquipTypeModTo.setText(this.information.getEquipTo());
            this.txtconfigIdFrom.setText(this.information.getConfigIdFrom());
            this.txtConfigIdTo.setText(this.information.getConfigIdTo());
            this.txtLocationFrom.setText(this.information.getLocationFrom());
            this.txtLocationTo.setText(this.information.getLocationTo());
            this.txtAccountableFrom.setText(this.information.getAccntFrom());
            this.txtAccountableTo.setText(this.information.getAccntTo());
            this.txtNonBankStaffFrom.setText(this.information.getNbsFrom());
            this.txtNonBankStaffTo.setText(this.information.getNbsTo());
            this.txtReason.setText(this.information.getReason());
        }
        
        public MovementForm(ActionTaken actionTaken) {
            this();
            this.actionTaken = actionTaken;
            this.txtDescription.setText(this.actionTaken.getDescription());
            this.txtAction.setText(this.actionTaken.getAction());
            this.txtSerialNo.setText(this.actionTaken.getSerialNo());
            this.txtPropertyControlNo.setText(this.actionTaken.getPropertyControlNo());
            this.txtLoanDueDate.setText(this.actionTaken.getLoanDueDate());
        }
        
        public void setLogin(Login login) {
            this.login = login;
        }
        
        public Login getLogin() {
            return this.login;
        }
        
        public void setInformation(Information information) {
            this.information = information;
        }
        
        public Information getInformation() {
            return this.information;
        }
        
        public void setActionTaken(ActionTaken actionTaken) {
            this.actionTaken = actionTaken;
        }
        
        public ActionTaken getActionTaken() {
            return this.actionTaken;
        }
    
        /**
         * This method is called from within the constructor to initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is always
         * regenerated by the Form Editor.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
    
            lblTransactionNo = new javax.swing.JLabel();
            txtTransactionNo = new javax.swing.JTextField();
            jPanel1 = new javax.swing.JPanel();
            lblUserInformation = new javax.swing.JLabel();
            lblParticulars = new javax.swing.JLabel();
            lblFrom = new javax.swing.JLabel();
            lblto = new javax.swing.JLabel();
            lblDept = new javax.swing.JLabel();
            lblEquip = new javax.swing.JLabel();
            lblConfig = new javax.swing.JLabel();
            lblLocation = new javax.swing.JLabel();
            lblAccntRegStaff = new javax.swing.JLabel();
            lblNonBankStaff = new javax.swing.JLabel();
            lblReason = new javax.swing.JLabel();
            txtDeptOfficeFrom = new javax.swing.JTextField();
            txtEquipTypeModFrom = new javax.swing.JTextField();
            txtconfigIdFrom = new javax.swing.JTextField();
            txtLocationFrom = new javax.swing.JTextField();
            txtAccountableFrom = new javax.swing.JTextField();
            txtNonBankStaffFrom = new javax.swing.JTextField();
            txtReason = new javax.swing.JTextField();
            txtDeptOfficeTo = new javax.swing.JTextField();
            txtEquipTypeModTo = new javax.swing.JTextField();
            txtConfigIdTo = new javax.swing.JTextField();
            txtLocationTo = new javax.swing.JTextField();
            txtAccountableTo = new javax.swing.JTextField();
            txtNonBankStaffTo = new javax.swing.JTextField();
            jSeparator2 = new javax.swing.JSeparator();
            jPanel2 = new javax.swing.JPanel();
            lblActionTakenByOist = new javax.swing.JLabel();
            lblDetails = new javax.swing.JLabel();
            jSeparator4 = new javax.swing.JSeparator();
            jScrollPane1 = new javax.swing.JScrollPane();
            tblDetails = new javax.swing.JTable();
            lblDescription = new javax.swing.JLabel();
            txtDescription = new javax.swing.JTextField();
            lblAction = new javax.swing.JLabel();
            cmbAction = new javax.swing.JComboBox();
            txtAction = new javax.swing.JTextField();
            lblSerialNo = new javax.swing.JLabel();
            txtSerialNo = new javax.swing.JTextField();
            lblPropertyControlNo = new javax.swing.JLabel();
            txtPropertyControlNo = new javax.swing.JTextField();
            lblLoanDueDate = new javax.swing.JLabel();
            txtLoanDueDate = new javax.swing.JTextField();
            lblJobCompletedBy = new javax.swing.JLabel();
            txtJobCompleted = new javax.swing.JTextField();
            lblDateCompleted = new javax.swing.JLabel();
            txtDateCompleted = new javax.swing.JTextField();
            lblUserAcceptance = new javax.swing.JLabel();
            txtUserAcceptance = new javax.swing.JTextField();
            lblDateAccept = new javax.swing.JLabel();
            txtDateAccept = new javax.swing.JTextField();
            lblRemarks = new javax.swing.JLabel();
            txtRemarks = new javax.swing.JTextField();
            btnAdd = new javax.swing.JButton();
            jSeparator5 = new javax.swing.JSeparator();
            btnSave = new javax.swing.JButton();
            btnSearch = new javax.swing.JButton();
            btnClose = new javax.swing.JButton();
            jButton1 = new javax.swing.JButton();
            jSeparator1 = new javax.swing.JSeparator();
            jSeparator3 = new javax.swing.JSeparator();
    
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Movement Form");
    
            lblTransactionNo.setText("Transaction No.");
    
            txtTransactionNo.setEditable(false);
    
            lblUserInformation.setText("User Information");
    
            lblParticulars.setText("Particulars");
    
            lblFrom.setText("From");
    
            lblto.setText("To");
    
            lblDept.setText("Department/Office");
    
            lblEquip.setText("Equipment Type and Model");
    
            lblConfig.setText("Config ID No./Serial No.");
    
            lblLocation.setText("Location");
    
            lblAccntRegStaff.setText("Accountable Regular Staff");
    
            lblNonBankStaff.setText("Non-Bank Staff");
    
            lblReason.setText("Reason");
    
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jSeparator2)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(lblDept)
                                .addComponent(lblEquip)
                                .addComponent(lblConfig)
                                .addComponent(lblLocation)
                                .addComponent(lblAccntRegStaff)
                                .addComponent(lblNonBankStaff)
                                .addComponent(lblReason))
                            .addGap(66, 66, 66)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(txtLocationFrom)
                                        .addComponent(txtAccountableFrom)
                                        .addComponent(txtNonBankStaffFrom, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
                                        .addComponent(txtDeptOfficeFrom)
                                        .addComponent(txtEquipTypeModFrom)
                                        .addComponent(txtconfigIdFrom))
                                    .addGap(50, 50, 50)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtDeptOfficeTo)
                                        .addComponent(txtEquipTypeModTo)
                                        .addComponent(txtConfigIdTo)
                                        .addComponent(txtLocationTo)
                                        .addComponent(txtAccountableTo)
                                        .addComponent(txtNonBankStaffTo)))
                                .addComponent(txtReason)))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(lblParticulars)
                            .addGap(229, 229, 229)
                            .addComponent(lblFrom)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(lblto)
                            .addGap(120, 120, 120))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addGap(0, 0, Short.MAX_VALUE)
                            .addComponent(lblUserInformation)
                            .addGap(317, 317, 317))))
            );
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addComponent(lblUserInformation)
                    .addGap(1, 1, 1)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(lblto)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtDeptOfficeFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtDeptOfficeTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(lblParticulars)
                                .addComponent(lblFrom))
                            .addGap(18, 18, 18)
                            .addComponent(lblDept)))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblEquip)
                        .addComponent(txtEquipTypeModFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtEquipTypeModTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblConfig)
                        .addComponent(txtconfigIdFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtConfigIdTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblLocation)
                        .addComponent(txtLocationFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtLocationTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblAccntRegStaff)
                        .addComponent(txtAccountableFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtAccountableTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblNonBankStaff)
                        .addComponent(txtNonBankStaffFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtNonBankStaffTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblReason)
                        .addComponent(txtReason, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
    
            lblActionTakenByOist.setText("Action Taken By OIST");
    
            lblDetails.setText("Details:");
    
            tblDetails.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {null, null, null, null, null, null},
                    {null, null, null, null, null, null},
                    {null, null, null, null, null, null},
                    {null, null, null, null, null, null}
                },
                new String [] {
                    "No.", "Description", "Action", "Serial No.", "Property Control No.", "Loan Due Date"
                }
            ));
            tblDetails.setEnabled(false);
            jScrollPane1.setViewportView(tblDetails);
            tblDetails.getColumnModel().getColumn(0).setMinWidth(40);
            tblDetails.getColumnModel().getColumn(0).setMaxWidth(40);
            tblDetails.getColumnModel().getColumn(2).setMinWidth(50);
            tblDetails.getColumnModel().getColumn(2).setMaxWidth(50);
            tblDetails.getColumnModel().getColumn(5).setMinWidth(100);
            tblDetails.getColumnModel().getColumn(5).setMaxWidth(100);
    
            lblDescription.setText("Description:");
    
            lblAction.setText("Action:");
    
            cmbAction.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NI", "RP", "ML", "SA", "PD", "SL", "RL", "PR", "LL", "TA", "RE", "OT" }));
            cmbAction.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmbActionActionPerformed(evt);
                }
            });
    
            txtAction.setEditable(false);
    
            lblSerialNo.setText("Serial No.");
    
            lblPropertyControlNo.setText("Property Control No.");
    
            lblLoanDueDate.setText("Loan Due Date");
    
            txtLoanDueDate.setEditable(false);
    
            lblJobCompletedBy.setText("Job Completed By:");
    
            lblDateCompleted.setText("Date:");
    
            lblUserAcceptance.setText("User Acceptance:");
    
            lblDateAccept.setText("Date:");
    
            lblRemarks.setText("Remarks:");
    
            btnAdd.setText("ADD");
            btnAdd.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btnAddActionPerformed(evt);
                }
            });
    
            btnSave.setText("SAVE");
            btnSave.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btnSaveActionPerformed(evt);
                }
            });
    
            btnSearch.setText("SEARCH");
    
            btnClose.setText("CLOSE");
            btnClose.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    btnCloseActionPerformed(evt);
                }
            });
    
            jButton1.setText("jButton1");
    
            javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jSeparator4)
                .addComponent(jSeparator5)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(lblDescription)
                                        .addComponent(lblAction)
                                        .addComponent(lblLoanDueDate))
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addGap(19, 19, 19)
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addGroup(jPanel2Layout.createSequentialGroup()
                                                    .addComponent(cmbAction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(txtAction))
                                                .addComponent(txtDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGap(44, 44, 44)
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(lblPropertyControlNo)
                                                .addComponent(lblSerialNo))
                                            .addGap(18, 18, 18)
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(txtSerialNo)
                                                .addComponent(txtPropertyControlNo)))
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addGap(18, 18, 18)
                                            .addComponent(txtLoanDueDate, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnAdd)
                                            .addGap(86, 86, 86)
                                            .addComponent(jButton1)
                                            .addGap(42, 42, 42))))
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(btnSave)
                                    .addGap(60, 60, 60)
                                    .addComponent(btnSearch)
                                    .addGap(58, 58, 58)
                                    .addComponent(btnClose))))
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(txtRemarks, javax.swing.GroupLayout.PREFERRED_SIZE, 686, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addGap(322, 322, 322)
                                            .addComponent(lblActionTakenByOist))
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addGap(27, 27, 27)
                                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(lblDetails)
                                                .addGroup(jPanel2Layout.createSequentialGroup()
                                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(lblJobCompletedBy)
                                                        .addComponent(lblUserAcceptance)
                                                        .addComponent(lblRemarks))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                        .addComponent(txtJobCompleted)
                                                        .addComponent(txtUserAcceptance, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE))
                                                    .addGap(56, 56, 56)
                                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(lblDateCompleted)
                                                        .addComponent(lblDateAccept))
                                                    .addGap(29, 29, 29)
                                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                        .addComponent(txtDateCompleted)
                                                        .addComponent(txtDateAccept, javax.swing.GroupLayout.DEFAULT_SIZE, 204, Short.MAX_VALUE))))))
                                    .addGap(92, 92, 92)))
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap())
                .addComponent(jScrollPane1)
            );
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(lblActionTakenByOist)
                    .addGap(1, 1, 1)
                    .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(31, 31, 31)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblDescription)
                        .addComponent(txtDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblSerialNo)
                        .addComponent(txtSerialNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(16, 16, 16)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblAction)
                        .addComponent(cmbAction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtAction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblPropertyControlNo)
                        .addComponent(txtPropertyControlNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(btnAdd)
                                .addComponent(jButton1))
                            .addGap(7, 7, 7))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(txtLoanDueDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(lblLoanDueDate))
                            .addGap(18, 18, 18)))
                    .addComponent(lblDetails)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(4, 4, 4)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(lblJobCompletedBy)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtJobCompleted, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblDateCompleted)
                            .addComponent(txtDateCompleted, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblUserAcceptance)
                        .addComponent(txtUserAcceptance, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lblDateAccept)
                        .addComponent(txtDateAccept, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(lblRemarks)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(txtRemarks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(btnSave)
                        .addComponent(btnSearch)
                        .addComponent(btnClose))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
    
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jSeparator1)
                        .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(lblTransactionNo)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(txtTransactionNo, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE))
                        .addComponent(jSeparator3))
                    .addContainerGap())
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblTransactionNo)
                        .addComponent(txtTransactionNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(3, 3, 3)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(7, 7, 7)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(2, 2, 2)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );
    
            pack();
        }// </editor-fold>                        
    
        private void cmbActionActionPerformed(java.awt.event.ActionEvent evt) {                                          
            // TODO add your handling code here:
            
            this.df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.ENGLISH);
            this.actionTaken = new ActionTaken(45);
            this.actionTaken.setAction(this.cmbAction.getSelectedItem().toString());
            this.txtAction.setText(this.actionTaken.getAction());
            if(this.txtAction.getText().equals("Short Term Loan")) {
                this.txtLoanDueDate.setText(""+df.format(this.actionTaken.getDate()));
            }
            else if(this.txtAction.getText().equals("Long Term")) {;
                this.txtLoanDueDate.setEditable(true);
                this.txtLoanDueDate.setText("");
            }
            else {
                this.txtLoanDueDate.setText("");
                this.txtLoanDueDate.setEditable(false);
            }
        }                                         
    
        private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
            this.dispose();
        }                                        
    
        private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {                                       
            // TODO add your handling code here:
            String description = this.txtDescription.getText();
            String action = this.txtAction.getText();
            String serialNo = this.txtSerialNo.getText();
            String propertyCtrlNo = this.txtPropertyControlNo.getText();
            String loanDueDate = this.txtLoanDueDate.getText();
            df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.ENGLISH);
            
            if(this.actionTaken == null) {
                this.actionTaken = this.information.addAction(description, action, serialNo, propertyCtrlNo);
    
                if(this.actionTaken != null) {
                    this.actionTaken.setLoanDueDate(""+df.format(this.txtLoanDueDate.getText()));
                    JOptionPane.showMessageDialog(this,"Action Details Successfully Added");
                }
                else {
                    this.actionTaken = null;
                    JOptionPane.showMessageDialog(this,"Action Details Failed to add");
                }
            }
            else {
                this.txtDescription.setText("");
                this.txtAction.setText("");
                this.txtSerialNo.setText("");
                this.txtPropertyControlNo.setText("");
            }
            this.populateList();
        }                                      
    
        private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {                                        
            // TODO add your handling code here:
            String deptFrom = this.txtDeptOfficeFrom.getText();
            String deptTo = this.txtDeptOfficeTo.getText();
            String equipFrom = this.txtEquipTypeModFrom.getText();
            String equipTo = this.txtEquipTypeModTo.getText();
            String configIdFrom = this.txtconfigIdFrom.getText();
            String configIdTo = this.txtConfigIdTo.getText();
            String locationFrom = this.txtLocationFrom.getText();
            String locationTo = this.txtLocationTo.getText();
            String accountFrom = this.txtAccountableFrom.getText();
            String accountTo = this.txtAccountableTo.getText();
            String nbsFrom = this.txtNonBankStaffFrom.getText();
            String nbsTo = this.txtNonBankStaffTo.getText();
            String reason = this.txtReason.getText();
            String jobCompletedBy = this.txtJobCompleted.getText();
            String userAcceptance = this.txtUserAcceptance.getText();
            String remarks = this.txtRemarks.getText();
            
            if(this.information == null) {
                this.information = this.login.addInformation(deptFrom, deptTo, equipFrom, equipTo, configIdFrom, configIdTo, locationFrom, locationTo, accountFrom, accountTo, nbsFrom, nbsTo, reason);
                
                if(this.information != null) {
                    this.txtJobCompleted.setText(this.information.getJobCompletedBy());
                    this.txtUserAcceptance.setText(this.information.getUserAcceptance());
                    this.txtRemarks.setText(this.information.getRemarks());
                    JOptionPane.showMessageDialog(this,"Information Successfully Added");
                }
            }
        }                                       
    
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            /*
             * Set the Nimbus look and feel
             */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /*
             * If Nimbus (introduced in Java SE 6) is not available, stay with the
             * default look and feel. For details see
             * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
             */
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(MovementForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(MovementForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(MovementForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(MovementForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
    
            /*
             * Create and display the form
             */
            java.awt.EventQueue.invokeLater(new Runnable() {
    
                public void run() {
                    new MovementForm().setVisible(true);
                }
            });
        }
        // Variables declaration - do not modify                     
        private javax.swing.JButton btnAdd;
        private javax.swing.JButton btnClose;
        private javax.swing.JButton btnSave;
        private javax.swing.JButton btnSearch;
        private javax.swing.JComboBox cmbAction;
        private javax.swing.JButton jButton1;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JSeparator jSeparator1;
        private javax.swing.JSeparator jSeparator2;
        private javax.swing.JSeparator jSeparator3;
        private javax.swing.JSeparator jSeparator4;
        private javax.swing.JSeparator jSeparator5;
        private javax.swing.JLabel lblAccntRegStaff;
        private javax.swing.JLabel lblAction;
        private javax.swing.JLabel lblActionTakenByOist;
        private javax.swing.JLabel lblConfig;
        private javax.swing.JLabel lblDateAccept;
        private javax.swing.JLabel lblDateCompleted;
        private javax.swing.JLabel lblDept;
        private javax.swing.JLabel lblDescription;
        private javax.swing.JLabel lblDetails;
        private javax.swing.JLabel lblEquip;
        private javax.swing.JLabel lblFrom;
        private javax.swing.JLabel lblJobCompletedBy;
        private javax.swing.JLabel lblLoanDueDate;
        private javax.swing.JLabel lblLocation;
        private javax.swing.JLabel lblNonBankStaff;
        private javax.swing.JLabel lblParticulars;
        private javax.swing.JLabel lblPropertyControlNo;
        private javax.swing.JLabel lblReason;
        private javax.swing.JLabel lblRemarks;
        private javax.swing.JLabel lblSerialNo;
        private javax.swing.JLabel lblTransactionNo;
        private javax.swing.JLabel lblUserAcceptance;
        private javax.swing.JLabel lblUserInformation;
        private javax.swing.JLabel lblto;
        private javax.swing.JTable tblDetails;
        private javax.swing.JTextField txtAccountableFrom;
        private javax.swing.JTextField txtAccountableTo;
        private javax.swing.JTextField txtAction;
        private javax.swing.JTextField txtConfigIdTo;
        private javax.swing.JTextField txtDateAccept;
        private javax.swing.JTextField txtDateCompleted;
        private javax.swing.JTextField txtDeptOfficeFrom;
        private javax.swing.JTextField txtDeptOfficeTo;
        private javax.swing.JTextField txtDescription;
        private javax.swing.JTextField txtEquipTypeModFrom;
        private javax.swing.JTextField txtEquipTypeModTo;
        private javax.swing.JTextField txtJobCompleted;
        private javax.swing.JTextField txtLoanDueDate;
        private javax.swing.JTextField txtLocationFrom;
        private javax.swing.JTextField txtLocationTo;
        private javax.swing.JTextField txtNonBankStaffFrom;
        private javax.swing.JTextField txtNonBankStaffTo;
        private javax.swing.JTextField txtPropertyControlNo;
        private javax.swing.JTextField txtReason;
        private javax.swing.JTextField txtRemarks;
        private javax.swing.JTextField txtSerialNo;
        private javax.swing.JTextField txtTransactionNo;
        private javax.swing.JTextField txtUserAcceptance;
        private javax.swing.JTextField txtconfigIdFrom;
        // End of variables declaration                   
        public void populateList() {
            ActionTable myAt = new ActionTable(this.information.getActionTakens());
            this.tblDetails.setModel(myAt);
            this.validate();
        }
    }

  5. #5
    gauravfzd's Avatar
    gauravfzd is offline Member
    Join Date
    Oct 2010
    Location
    India
    Posts
    72
    Rep Power
    0

    Default Re: HELP - MovementForm

    Well I don't know much about netbeans because I don't use it. I prefer eclipse over netbeans.

    I eclipse you can mark a particular statement as breakpoint and then run the program in debug mode. In this mode, eclipse will show you which variable is having null or a value or object.

    I believe Netbeans also provide the debug mode. Check it out to find which variable is having null and causing nullpointerexception

  6. #6
    javadroid13's Avatar
    javadroid13 is offline Member
    Join Date
    Dec 2011
    Posts
    7
    Rep Power
    0

    Default Re: HELP - MovementForm

    Quote Originally Posted by gauravfzd View Post
    Well I don't know much about netbeans because I don't use it. I prefer eclipse over netbeans.

    I eclipse you can mark a particular statement as breakpoint and then run the program in debug mode. In this mode, eclipse will show you which variable is having null or a value or object.

    I believe Netbeans also provide the debug mode. Check it out to find which variable is having null and causing nullpointerexception
    Ok Sir but how to install palettes add-on(GUI) in Eclipse?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •