1

I want to do that:

JFileChooser fileChooser = new JFileChooser();
fileChooser.setCurrentDirectory(new File(System.getProperty(**MY DOCUMENTS PATH **)));

All I want to do is to put the "My Documents" path, that it changes in different windows versions, but I don't know how to do it.

I can't use a "literal path" I need a relative path because this application is going to work on all windows versions and I can't use literal paths.

Imrik
  • 674
  • 2
  • 14
  • 32

1 Answers1

5

as far as I know this is the "my document" path for all windows versions:

String myDocumentPath = System.getProperty("user.home") + "Documents";
nafas
  • 5,283
  • 3
  • 29
  • 57