title: Get the path of chosen file java
body: <p>How to display a JFileChooser so I get the absolute path of a file, then assign the path to a string</p>
  
  <p>I was doing something like:</p>
  
  <pre><code>JFileChooser chooser = new JFileChooser();
  chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
  </code></pre>