title: Java: How to show the content of a file, opened by JFileChooser, in a JTextField?
body: <p>I'm starting to learn Java and don't know how to show the content of a given file, that is opened by JFileChooser, in a JTextField </p>
  
  <p>This is my code so far. </p>
  
  <p>I deleted some imports and code for the better understanding of my program.</p>
  
  <pre><code>public class Afvink6 extends JFrame implements ActionListener {
  
  private JLabel bestandnaam;
  private JTextField bestand;
  private JButton blader;
  private JButton analyseer;
  private JLabel informatie;
  private JTextArea textarea;
  private JLabel naampercentage;
  private JPanel percentages;
  private PrintWriter outFile;
  private JFileChooser fileChooser;
  private int reply;
  
  
  
  
  @Override
  public void actionPerformed(ActionEvent event) {
  
      if(event.getSource() == blader){
          fileChooser = new JFileChooser();
          reply = fileChooser.showOpenDialog(this);
          if (reply == JFileChooser.APPROVE_OPTION) {
              File selectedFile = fileChooser.getSelectedFile();
              bestand.setText(selectedFile.getAbsolutePath());
          }
      }
  
      if(event.getSource() ==analyseer){
  </code></pre>
  
  <p>Hope someone can help me! </p>