title: jtable only populates one row with value from the linkedlist
body: <p>so i have this class that holds the name, address and city of an employee. afterwards the class is been stored in a linkedlist &amp; when the user enters the name , address and city in a textfield, the values are being inserted into the linkedlist, and then populated on a jtable. so far, i have been able to get the user details and added it to the likedlist, but when i click on the add button, it only adds one row to the table, if i insert some other values in the textfield and click on the addbutton again, it just removes the previously added row and adds the new one still displaying just one row, i want the jtable to display all values. here is my code please.</p>
  
  <pre><code>public class EmployeeDetails extends javax.swing.JFrame {
  String [] str = {"NAME", "ADDRESS", "CITY", "ZICODE"};
  LinkedList&lt;EmployeeDetails&gt; linkedlist;
  String name;
  String address;
  String city;
  String zipcode;
  
  
  public EmployeeDetails(String name, String address, String city, String zipcode) {
     this.name = name;
     this.address = address;
     this.city = city;
     this.zipcode = zipcode;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public String getName() {
      return name;
  }
  
  public void setAddres(String address) {
      this.address = address;
  }
  
  public String getAddress() {
      return address;
  }
  
  public void setCity(String city) {
      this.city = city;
  }
  
  public String getCity() {
      return city;
  }
  
  public void setZip(String zipcode) {
      this.zipcode = zipcode;
  }
  
  public String getZip() {
      return zipcode;
  }
  
  public String toString() {
      return name + " " + address + " " + city + " " + zipcode;
  }
  
  public EmployeeDetails() {
      initComponents();
  }
  
  //this is the method that does the adding
  public void add() {
      name = nametxt.getText().trim();
      address = addresstxt.getText().trim();
      city = citytxt.getText().trim();
      zipcode = zipcodetxt.getText().trim();
  
      linkedlist = new LinkedList&lt;&gt;();
      linkedlist.add(new EmployeeDetails(name, address, city, zipcode));
      DefaultTableModel model = new DefaultTableModel(str, linkedlist.size());
  
      for(EmployeeDetails details : linkedlist) {
          System.out.println(details);
          model.addRow(new Object[]{details.getName()details.getAddress(), details.getCity(), details.getZip()});
      }
  
      employeeTable.setModel(model);
  }
  }
  </code></pre>