简体   繁体   中英

Is there a way to set a JFileChooser to start from a certain file?

I've created a file chooser as such:

private JFileChooser jfc = new JFileChooser(".");

Now this obviously opens up the current folder, in eclipse its the workshop folder. How do I make it so that it starts from where I have a certain file. I tried:

private JFileChooser jfc = new JFileChooser("pictureFile.png");

but it doesn't go to the file with that name.

EDIT:

Is there a way to add a picture file to my package folder for the project in eclipse?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM