This site requires JavaScript, please enable it in your browser!
Greenfoot back
divinity
divinity wrote ...

2017/10/11

voter app prev record not showing up neither next

divinity divinity

2017/10/11

#
hi danpost I am currently doing a voters app where u can add save, new and previous and go to the next record. everything else seem to be working fine but when i tried to view the previous record it is not working, can u take a look at the codes and tell me where i can gone wrong and where i can improver. here is the codes this is the voters info where i am getting the name age etc
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package votersapp;

import java.io.Serializable;
import java.util.HashMap;

/**
 *
 * @author luanataylor
 */
public class VotersInfo implements Serializable{
    
    
    //inistiating variable
    private String FirstName;
    private String LastName;
    private String EmailID;
    private String HomeAddress;
    private String RegNo;
    private String ContactNumber;
    private String position;
    private String FirstTime;
    private String age;
   
    
    
    
    public VotersInfo(){
        
        this.FirstName = "";
        this.LastName = "";
        this.EmailID = "";
        this.HomeAddress = "";
        this.ContactNumber = "";
        this.position = "";
        this.FirstTime = "";
        this.age = "";
        this.RegNo="";
       
        
    }

    public String getFirstName() {
        return FirstName;
    }

    public String getLastName() {
        return LastName;
    }

    public String getEmailID() {
        return EmailID;
    }

    public String getHomeAddress() {
        return HomeAddress;
    }

    public String getContactNumber() {
        return ContactNumber;
    }

    public String getPosition() {
        return position;
    }

    public String getFirstTime() {
        return FirstTime;
    }
    public String getRegNo() {
        return RegNo;
    }

    public String getAge() {
        return age;
    }
    

    public void setVoter(HashMap <String, String >voter ){
        
         this.FirstName = voter.get("FirstName");
        this.LastName = voter.get("LastName");
        this.EmailID = voter.get("EmailID");
        this.HomeAddress = voter.get("HomeAddress");
        this.ContactNumber = voter.get("ContactNumber");
        this.position = voter.get("position");
        this.FirstTime = voter.get("FirstTime");
        this.age = voter.get("age");
        this.RegNo = voter.get("RegNo");
        
    }
    
    
}
this another class 
       list.add(position, this.v);


and this is the gui part of the program 

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package votersapp;

import java.util.HashMap;

/**
 *
 * @author luanataylor
 */
public class Voters_reg1 extends javax.swing.JFrame {
    HashMap<String, String>voterInfo;
    public VotersOps  voter;
    public int currentpos;
    
    public Voters_reg1() {
        initComponents();
        
        this.voter = new VotersOps();
        this.voterInfo = new HashMap();
        int size = voter.list.size();
        jtf1.setText(String.valueOf(size + 1));
        jtf2.setText(String.valueOf(size + 1));
        this.currentpos = 1;
    }
    
    
    
    /**
     * 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() {

        jPanel2 = new javax.swing.JPanel();
        fnamelbl = new javax.swing.JLabel();
        fntxtf = new javax.swing.JTextField();
        lnamelbl = new javax.swing.JLabel();
        lntxtf = new javax.swing.JTextField();
        regnumlbl = new javax.swing.JLabel();
        regnumtxtf = new javax.swing.JTextField();
        agelbl = new javax.swing.JLabel();
        agetxtf = new javax.swing.JTextField();
        emaillbl = new javax.swing.JLabel();
        emailtxtf = new javax.swing.JTextField();
        contactnumlbl = new javax.swing.JLabel();
        contacttxtf = new javax.swing.JTextField();
        addresslbl = new javax.swing.JLabel();
        addresstxtf = new javax.swing.JTextField();
        postlbl = new javax.swing.JLabel();
        postcbox = new javax.swing.JComboBox();
        firsttimelbl = new javax.swing.JLabel();
        yesbtn = new javax.swing.JRadioButton();
        nobtn = new javax.swing.JRadioButton();
        savebtn = new javax.swing.JButton();
        newbtn = new javax.swing.JButton();
        exit = new javax.swing.JButton();
        prevbtn = new javax.swing.JButton();
        jtf1 = new javax.swing.JTextField();
        jtf2 = new javax.swing.JTextField();
        nextbtn2 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        fnamelbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        fnamelbl.setText("First Name");

        fntxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        lnamelbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        lnamelbl.setText("Last Name");

        lntxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        regnumlbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        regnumlbl.setText("Reg. No.");

        regnumtxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        agelbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        agelbl.setText("Age");

        agetxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        emaillbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        emaillbl.setText("Email ID");

        emailtxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        contactnumlbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        contactnumlbl.setText("Contact No.");

        contacttxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        addresslbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        addresslbl.setText("Home Address");

        addresstxtf.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N

        postlbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        postlbl.setText("Position");

        postcbox.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        postcbox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cerk I", "Clerk Typist I", "Manager", "Administrator" }));

        firsttimelbl.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        firsttimelbl.setText("First Time");

        yesbtn.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        yesbtn.setText("Yes");

        nobtn.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        nobtn.setText("No");

        savebtn.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        savebtn.setText("Save");
        savebtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                savebtnActionPerformed(evt);
            }
        });

        newbtn.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        newbtn.setText("New");
        newbtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newbtnActionPerformed(evt);
            }
        });

        exit.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        exit.setText("Exit");
        exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitActionPerformed(evt);
            }
        });

        prevbtn.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        prevbtn.setText("Previous");
        prevbtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                prevbtnActionPerformed(evt);
            }
        });

        jtf1.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        jtf1.setEnabled(false);

        jtf2.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        jtf2.setEnabled(false);

        nextbtn2.setFont(new java.awt.Font("Cambria", 3, 12)); // NOI18N
        nextbtn2.setText("Next");
        nextbtn2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextbtn2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(209, 209, 209)
                        .addComponent(jtf2, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
                        .addGap(18, 18, 18)
                        .addComponent(nextbtn2, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(138, 138, 138))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(agelbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(regnumlbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lnamelbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(fnamelbl, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
                            .addComponent(emaillbl))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(fntxtf)
                            .addComponent(lntxtf)
                            .addComponent(regnumtxtf)
                            .addComponent(agetxtf)
                            .addComponent(emailtxtf, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE))
                        .addGap(51, 51, 51)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(contactnumlbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(addresslbl, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
                            .addComponent(postlbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(firsttimelbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(contacttxtf)
                            .addComponent(addresstxtf)
                            .addComponent(postcbox, 0, 122, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(yesbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(nobtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(newbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(33, 33, 33)
                                .addComponent(savebtn, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(prevbtn)
                                .addGap(18, 18, 18)
                                .addComponent(jtf1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(58, 58, 58)
                        .addComponent(exit, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(fnamelbl)
                    .addComponent(fntxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(contactnumlbl)
                    .addComponent(contacttxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lnamelbl)
                            .addComponent(lntxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(addresslbl)
                            .addComponent(addresstxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(regnumlbl)
                            .addComponent(regnumtxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(postlbl))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(agelbl)
                                            .addComponent(agetxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(21, 21, 21)
                                        .addComponent(firsttimelbl)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(emaillbl)
                                    .addComponent(emailtxtf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(21, 21, 21)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(yesbtn)
                                    .addComponent(nobtn)))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(46, 46, 46)
                        .addComponent(postcbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(26, 26, 26)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nextbtn2)
                    .addComponent(prevbtn))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 66, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(newbtn)
                    .addComponent(exit)
                    .addComponent(savebtn))
                .addGap(35, 35, 35))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 10, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>                        

    private void exitActionPerformed(java.awt.event.ActionEvent evt) {                                     
       System.exit(0);
      
    }                                    

    private void newbtnActionPerformed(java.awt.event.ActionEvent evt) {                                       
        fntxtf.setText("");
        lntxtf.setText("");
        regnumtxtf.setText("");
        agetxtf.setText("");
        emailtxtf.setText("");
        contacttxtf.setText("");
        addresstxtf.setText("");
        
        int size = voter.list.size();
        
        if(size > 0){
            this.currentpos ++ ;
        }else{
            this.currentpos =1;
        }
        jtf1.setText(String.valueOf(this.currentpos ));
        jtf2.setText(String.valueOf(size + 1));
        System.out.println("pos: " );
        System.out.println(this.currentpos);
    }                                      

    private void savebtnActionPerformed(java.awt.event.ActionEvent evt) {                                        
        this.voterInfo.put("FirstName",fntxtf.getText());
        this.voterInfo.put("LastName", lntxtf.getText());
        this.voterInfo.put("RegNo", regnumtxtf.getText());
        this.voterInfo.put("Age", agetxtf.getText());
        this.voterInfo.put("EmailID", emailtxtf.getText());
        this.voterInfo.put("ContactNo", contacttxtf.getText());
       this. voterInfo.put("HomeAddress", addresstxtf.getText());
        
         int index = this.currentpos;
          System.out.println(index);
        voter.setVotersInfo(this.voterInfo);
         voter.addvoter(index-1);
         
        
         try{
             
               voter.saveVoterInfo();
             
         }catch(Exception e){
             
         }
       
         
    }                                       

    private void prevbtnActionPerformed(java.awt.event.ActionEvent evt) {                                        
        System.out.println(this.currentpos);
        
        if(this.currentpos > 1){
            this.currentpos--;
            
        }
             fntxtf.setText(voter.list.get(this.currentpos-1).getFirstName());
            System.out.println(voter.list.get(this.currentpos-1).getFirstName());
            jtf1.setText(String.valueOf(this.currentpos));
             System.out.println(this.currentpos);
    }                                       

    private void nextbtn2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
         int size = voter.list.size();
         if(this.currentpos < size ){
            this.currentpos++;
            jtf1.setText(String.valueOf(this.currentpos ));
        }
    }                                        

    /**
     * @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(Voters_reg1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Voters_reg1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Voters_reg1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Voters_reg1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Voters_reg1().setVisible(true);
            }
        });
    }
     VotersOps vote = new VotersOps();

    // Variables declaration - do not modify                     
    private javax.swing.JLabel addresslbl;
    private javax.swing.JTextField addresstxtf;
    private javax.swing.JLabel agelbl;
    private javax.swing.JTextField agetxtf;
    private javax.swing.JLabel contactnumlbl;
    private javax.swing.JTextField contacttxtf;
    private javax.swing.JLabel emaillbl;
    private javax.swing.JTextField emailtxtf;
    private javax.swing.JButton exit;
    private javax.swing.JLabel firsttimelbl;
    private javax.swing.JLabel fnamelbl;
    private javax.swing.JTextField fntxtf;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField jtf1;
    private javax.swing.JTextField jtf2;
    private javax.swing.JLabel lnamelbl;
    private javax.swing.JTextField lntxtf;
    private javax.swing.JButton newbtn;
    private javax.swing.JButton nextbtn2;
    private javax.swing.JRadioButton nobtn;
    private javax.swing.JComboBox postcbox;
    private javax.swing.JLabel postlbl;
    private javax.swing.JButton prevbtn;
    private javax.swing.JLabel regnumlbl;
    private javax.swing.JTextField regnumtxtf;
    private javax.swing.JButton savebtn;
    private javax.swing.JRadioButton yesbtn;
    // End of variables declaration                   
}
danpost danpost

2017/10/12

#
Maybe I am missing something; but, I do not see at all where you might be using the VotersInfo class at (I do not see any VotersInfo object being created or any code that tries to use a VotersInfo object). Could you possibly direct me to where the class or any object of that class is being used, please.
You need to login to post a reply.