title: java actionListener: retrieve TextField in a separate thread
body: <p>i have a Frame which look like this: 
  </p>
  
  <pre class="lang-java prettyprint-override"><code>public class Load_Frame extends JFrame implements ActionListener{
  
      private JButton uploadButton, downloadButton;
      private JTextField uploadField;
      private String filename;
      private Client client;
  
      public Load_Frame(String username, Socket socket) {
  
          this.client = new Client(username, socket);
  
          uploadField = new JTextField ();
          uploadField.setBounds(60,100,450,30);
          uploadButton = new JButton ("Upload");
          uploadButton.setBounds(410,150,100,30);
          uploadButton.addActionListener(this);
  
          downloadButton = new JButton ("Download");
          downloadButton.setBounds(390,300,120,30);
          downloadButton.addActionListener(this);
  
  
          this.add(uploadField);
          this.add(uploadButton);
          this.add(downloadButton);
          this.setVisible(true);
  
      }
  
      public  void    actionPerformed(ActionEvent e)
      { 
          //Upload: 
          if  (e.getSource()== uploadButton) {
              this.filename = uploadField.getText();
              File file = new File(filename);             
              client.upload(file);
          }
  
          //Download
          else if (e.getSource()== downloadButton) {
              filename = (String) filesList.getSelectedItem();
              client.download(filename);
          }
  
  }
  </code></pre>
  
  <p>My problem is: i have been said that the frame and the "process" should be separated in different thread, so that when the process fail the frame don't freeze. So i need my Client to be a new thread. </p>
  
  <p>But then, i still need acess to those "upload" and "download" button. I've read that i can easily do that like it: </p>
  
  <pre class="lang-java prettyprint-override"><code>public class Client implements Runnable, ActionListener{
      ...
      public void actionPerformed(ActionEvent e){
          if(e.getSource() == uploadButton){
              File file  = new File(filename); //how can i retrieve the filename??
              upload(file);
      }
  }
  </code></pre>
  
  <p>and i'll just need to add another actionListener in my Frame class like that: </p>
  
  <pre class="lang-java prettyprint-override"><code>uploadButton.addActionListener(client);
  </code></pre>
  
  <p>(same for download of course)</p>
  
  <p>My prolem is: how can i get the filename, the text written in the TextField of my Frame?? Should i give this TextField as a parameter for my client ? This will make the code look weird, and by weird i mean not very logical, so i hope there is another way to do so.</p>