Set JFileChooser path to resource

Hi all,

I have a problem when i want to set the current directory to a JFileChooser pointing to my resource. (Program Node Contribution)

I’ve done this, but it doesn’t work:

JFileChooserObj.setCurrentDirectory(this.getClass().getResources("/"));

How can i take the absolute path? or another way to do it?

Thanks!!

1 Like

Hello @jorgevergara1993,

There was a similar issue posted a while back, you can check it out here. Let me know if that helps!

the code you are suggesting worked fine to Read, @inu, but Im having troubles writing to that file.

could you share a snip of code to writing o an existent .txt file on my resource folder?