Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

How do you use JFileChooser?

  Asked By: Diane    Date: Nov 16    Category: Java    Views: 688
  

I'm sorta clueless on what else to do with this I know there's
more but I'm not quite sure how to do this. I'm trying to use
JFileChooser

I know I'm supposed to do this:

public void fileChooser()
{
JFileChooser chooser = new JFileChooser();

if(chooser.showOpenDialog(null) ==
JFileChooser.APPROVE_OPTION)
{
selectedFile = chooser.getSelectedFile();
}

but I'm not quite sure how to do the rest where some1 can actually
choose a file on the computer..... :-s could someone please show me
how???

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Lu Fischer     Answered On: Nov 16

I Think my this work may be helped you in ur work. try it

 
Answer #2    Answered By: Alfonso Martin     Answered On: Nov 16

Just in my opinion: don't use JFileChooser, use the
old AWT Filehandler, it's less buggy.

 
Didn't find what you were looking for? Find more on How do you use JFileChooser? Or get search suggestion and latest updates.




Tagged: