title: read content from text field in another class
body: <p>I have two classes, one class is a GUI which asks the user to select 2 file directories and displays the directories in the two text fields "input Line" and "input Line 1" respectively text field.
  the second class is supposed to read these two directories and perform an indexing operation.
  My problem is I do not know how to get the second class to read the directory(path) in the text field from the first class into the "index path" and "doc path"
  I have tried importing the first class but it still didn't work
  it gives me a n error message saying "input Line cannot be resolved to a variable. these are the classes and their codes:
  first class snippet:</p>
  
  <pre><code>openButton.addActionListener(new ActionListener() {
          public  void actionPerformed(ActionEvent ae) {
            JFileChooser chooser = new JFileChooser();
            chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int option = chooser.showOpenDialog(uploaad.this);
            if (option == JFileChooser.APPROVE_OPTION) {
                File file = chooser.getSelectedFile();
                inputLine.setText(file.getAbsolutePath());
  
            }
            else {
              statusbar.setText("You canceled.");
            }
          }
        });
  
  
      indexButton.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ap) {
              JFileChooser chooser = new JFileChooser();
                chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                int option = chooser.showOpenDialog(uploaad.this);
                if (option == JFileChooser.APPROVE_OPTION) {
                    File file = chooser.getSelectedFile();
                    inputLine1.setText(file.getAbsolutePath());
  
                }
                else {
                  statusbar.setText("You canceled.");
                }
              }
            });
  </code></pre>
  
  <p>second class snippet:</p>
  
  <pre><code> String indexPath = inputLine.getText;
      String docsPath = inputLine1;
      boolean create = true;
      for(int i=0;i&lt;args.length;i++) {
       if ("-index".equals(args[i])) {
      indexPath = args[i+1];
      i++;
      } else if ("-docs".equals(args[i])) {
      docsPath = args[i+1];
      i++;
      } else if ("-update".equals(args[i])) {
        create = false;
       }
     }
  
     if (docsPath == null) {
     System.err.println("Usage: " + usage);
     System.exit(1);
      }
  
    final Path docDir = Paths.get(docsPath);
    if (!Files.isReadable(docDir)) {
    System.out.println("Document directory '" +docDir.toAbsolutePath()+ "'  
    does not exist or is not readable, please check the path");           
    System.exit(1);
  }
  </code></pre>