Auto generate id
<p>I'm trying to auto generate an id for customers, 
and all i get is 0 every time. 
Pretty sure the problem is in <code>public void regCustomer()</code>.</p>

<pre><code>public class User {
private String firstName, gender, age;
String surename;
private int customerID;
private static int idCounter = 1000;
User next;

public User(String fN, String sn, String g, String a) {
    firstName = fN;
    surename = sn;
    gender = g;
    age = a;
    //customerID = cID;
    next = null;
}

public void setCustomerID() {
    customerID = idCounter++;
}

public int getCustomerID() {
    return customerID;
}

public String toString() {
    return customerID + "\t" + surename + "\t" + firstName + "\t" + age
            + "\t" + gender;

}
</code></pre>

<p>}</p>

<p>In the <code>Window</code> class</p>

<pre><code>public void regCustomer() {


    //int customerID = 0;//= Integer.parseInt(customerIDField.getText());
    String firstName = firstNameField.getText();
    String surename = surenameField.getText();
    String gender = genderField.getText();
    String age = ageField.getText();

    if (!firstName.equals("") &amp;&amp; !surename.equals("") &amp;&amp; !gender.equals("")&amp;&amp; !age.equals("")) {
        userA.regCustomer(new User(firstName, surename, gender,age));
        User u = new User(firstName, surename, gender,age);
        u.getCustomerID();
        customerIDField.setText("");
        firstNameField.setText("");
        surenameField.setText("");
        ageField.setText("");
        genderField.setText("");
        firstNameField.requestFocus();
    } else
        JOptionPane.showMessageDialog(this, "Alle felt må fylles inn");
}
</code></pre>
