Jump to content

changing the jfilechoosers default directory

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Shaddix

Shaddix

    Programmer

  • Members
  • PipPipPipPip
  • 102 posts
if you use a jfilechooser the default directory that appears is "my documents"
is it possible to change that to a custom directory? like c:\ ?

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
isn't it this:
JFileChooser(String currentDirectoryPath)

Constructs a JFileChooser using the given path. Passing in a null string causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.

Parameters:
currentDirectoryPath - a String giving the path to a file or directory

from: JFileChooser (Java 2 Platform SE v1.4.2))