title: How to update JTextArea with JButton without it dulicating
body: <p>I have searched this site, and others looking for an answer.</p>
  
  <p>I have created a GUI to calculate retail discounts. I can enter the information, use the calculate button to perform the calculations, and add it to a list that displays in a JTextArea. Then I use a new item button to clear the areas (except text field). When I click the button "add to list" for a second item it works but puts two copies of the information in the text area. How do get it to only put one copy of information? </p>
  
  <p>Below is the code for the event listener for the "add to list" button</p>
  
  <pre><code>  /*
     * Private inner class to handle add to list event
     */
  
    private class AddListener implements ActionListener
    {
        @Override
        public void actionPerformed (ActionEvent a)
        {            
            //Get and set sale item name to ItemList object
            String name = saleItem.getName();
            iL.setName(name);
            //Get and set department name to ItemList object
            String dept = dP.getDep();
            iL.setDpt(dept);
            //Get and set original price to ItemList object
            String oP = dsP.getOrg();
            iL.setOp(oP);
            //Get and set sale price to ItemList object
            String sP = dsP.getSale();
            iL.setSp(sP);
  
            //Add ItemList object to ArrayList
            iList.add(iL);
  
            final String text = "Sale Item: \t" + iL.getSIname() +
                                "\nDepartment: \t" + iL.getDpt() +
                                "\nOriginal Price: \t$" + iL.getOp() +
                                "\nSale Price: \t$" + iL.getSp() + "\n\n";
  
            //Add ArrayList to text area
            for(int index = 0; index &lt; iList.size(); index++)
            {
                ItemList iLt = (ItemList)iList.get(index);
                itemL.append(text);
            }   
        }
    }
  </code></pre>