Hi,
How can I open the Swing-FileSelector in a special subdir?
I tried it with the pathname as String, but the FileSelector starts
always in the default dir.
Thank you.
Greetings,
Michael Pock
Thomas Kellerer - 12 May 2004 15:25 GMT
> Hi,
>
> How can I open the Swing-FileSelector in a special subdir?
>
> I tried it with the pathname as String, but the FileSelector starts
> always in the default dir.
This works for me (JDK 1.4.2):
JFileChooser fc = new JFileChooser("c:/temp");
Thomas
Lee Weiner - 12 May 2004 22:06 GMT
>Hi,
>
>How can I open the Swing-FileSelector in a special subdir?
>
>I tried it with the pathname as String, but the FileSelector starts
>always in the default dir.
If you're talking about JFileChooser, use the setCurrentDirectory() method,
but it doesn't take a String parameter, it takes a File object parameter:
myChooser.setCurrentDirectory( new File("startingdir") );
Lee Weiner
lee AT leeweiner DOT org