title: Cannot find symbol - method getAbsolutePath() java
body: <p>I try to use the method "getAbsolutePath()" but I always get the same error.
  Here is how I try to use it : </p>
  
  <pre><code>class OpenFrequenciesL implements ActionListener {
          public void actionPerformed(ActionEvent e) {
              JFileChooser fileChooser = new JFileChooser();
              final FileNameExtensionFilter filter = new FileNameExtensionFilter("Text", "txt");
              fileChooser.setFileFilter(filter);
              int fileChooserResult = fileChooser.showOpenDialog(MyGUI.this);
              if (fileChooserResult == JFileChooser.APPROVE_OPTION) {
                  filename.setText(fileChooser.getSelectedFile().getName());
                  dir.setText(readLineByLineJava8(fileChooser.getAbsolutePath()));
              } if (fileChooserResult == JFileChooser.CANCEL_OPTION) {
                  filename.setText("You pressed cancel");
                  dir.setText("");
                  }
              }
          }
  </code></pre>
  
  <p>I might need to import something but honestly I'm not even sure what I'm doing wrong at this point. Here's all that I imported : </p>
  
  <pre><code>import java.awt.BorderLayout;
  import java.awt.Container;
  import java.awt.GridLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.JButton;
  import javax.swing.JFileChooser;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.JTextField;
  import javax.swing.filechooser.FileNameExtensionFilter;
  import javax.swing.JFileChooser;
  import javax.swing.text.JTextComponent;
  import java.util.*;
  import java.io.*;
  import java.nio.file.*;
  import java.io.IOException;
  import java.nio.charset.StandardCharsets;
  import java.nio.file.Files;
  import java.nio.file.Paths;
  import java.util.stream.Stream;
  import java.io.File;
  </code></pre>