0

I want to read in a text file but I want to actually be able to open up the directory(wherever the program is ran) and navigate to wherever I want to a .txt file. How can I do this in java?

David
  • 45
  • 3
  • [JFileChooser?](https://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html) – markspace Nov 25 '15 at 19:12
  • Or, for JavaFX: https://docs.oracle.com/javase/8/javafx/api/javafx/stage/FileChooser.html | If you specify your poison of choice (AWT, Java FX, etc, one can help you better.) – showp1984 Nov 25 '15 at 19:16
  • This is console based. So it's not a GUI. This is probably not possible from the console now that I'm thinking about it but I'd thought I ask. – David Nov 25 '15 at 19:32
  • Are you asking how to write a console-based user interface that allows the user to browse the file system? – VGR Nov 25 '15 at 20:01
  • Essentially, yes. The only UI part that I'd like is the navigation to a .txt file to read from. Does that make sense and is that possible? – David Nov 25 '15 at 20:14

0 Answers0