Search code examples
javajavafxfilechooser

Javafx file chooser print name of file to term


Hey is there a method the will print the name of the file I choose to the term So I open a file using the javafx filechooser and am looking for a way to save the name of the file I opened in a string and print it to the terminal ? Thanks


Solution

  • Use this

    String  name = new File(path).getName();