Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. Frame frame = null;
  2. FileDialog fileBox = new FileDialog(frame, "Open a file", FileDialog.LOAD);
  3. fileBox.setVisible(true);
  4.  
  5. String filename = fileBox.getFile();
  6. String directoryPath = fileBox.getDirectory();
  7.  
  8. File inFile = new File(directoryPath, filename);
  9. Scanner scanner = new Scanner(inFile);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement