Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Clifton Flores   on Sep 11 In Java Category.

  
Question Answered By: Alfonsine Miller   on Sep 11

JFileChooser chooser = new JFileChooser();
if(chooser.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION){
File file  = chooser.getSelectedFile();
FileReader reader = new FileReader(file);
}


This is just a minimal bit  of code, but it should do the job. There are
lot of other features that you can use as well, such as file filters,
but I will leave that up to you. You can also take a look at the Java
API documentation for the JFileChooser and see the example they provide.

Share: 

 
 
Didn't find what you were looking for? Find more on FileChoosers - currentDirectory Or get search suggestion and latest updates.