title: How to get file path from JavaFX FileChooser?
body: <p>I have a simple JavaFX window with a TextField for users to enter a file path and a separate browse link.</p>
  
  <p><a href="https://i.stack.imgur.com/SQCjq.jpg" rel="noreferrer">JavaFX Window</a></p>
  
  <p><a href="https://i.stack.imgur.com/xxA9K.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/xxA9K.jpg" alt="enter image description here"></a></p>
  
  <p>I'd like to ask how to extract the full file path of the selected file from JavaFX FileChooser (so I can set the path in the TextField)?</p>
  
  <p>I understand what I'm trying to achieve can be done simply with Swing JFileChooser with something like:</p>
  
  <pre><code>JFileChooser chooser = new JFileChooser();
  String someString = chooser.getSelectedFile().toString();
  </code></pre>
  
  <p>But since my application is in JavaFX I want it to have a consistent look and not a mix with Swing.</p>
  
  <p>I've looked through the documentation, there doesn't seem to be a method for this <a href="https://docs.oracle.com/javase/8/javafx/api/javafx/stage/FileChooser.html" rel="noreferrer">https://docs.oracle.com/javase/8/javafx/api/javafx/stage/FileChooser.html</a></p>
  
  <p>Thanks in advance.</p>