title: add tab to jTabbedPane where each tab has a textArea with a different name java
body: <p>I am trying to dynamically add tabs to a JTabbedPane i do this with the following code:</p>
  
  <pre><code>private tab = new JTabbedPane();
  
  frame.add(tab, BorderLayout.CENTER);
  
  public void newTab(String tab){
        JPanel panel1 = new JPanel();
        JTextArea tArea = new JTextArea();
        panel1.add(tArea);
        tab.add(tab, panel1);
        }
  </code></pre>
  
  <p>The problem is that I need the text area name to be viewable through out the class so i can append to it later and there it should be able to lots of tabs so each text area should have a different name.</p>
  
  <p>Any Ideas? </p>