We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › how i get Directory chooser window
Page Index Toggle Pages: 1
how i get Directory chooser window ? (Read 1196 times)
how i get Directory chooser window ?
May 25th, 2010, 1:33pm
 
Hi
i would like to know how to open file directory chooser window.
I need to choose only a directory. (without entering file name).

I try with FileDialog class but i always have to specify file name.

I just want to choose only a directory , press 'OK' and store its path in some variable
Re: how i get Directory chooser window ?
Reply #1 - May 25th, 2010, 10:11pm
 
selectInput() and selectOutput() are to choose a file, selectFolder() is to choose a folder.
Re: how i get Directory chooser window ?
Reply #2 - May 26th, 2010, 3:12am
 
I would rather System filedialog than java filechooser.
I try to find another way to chose directory without: selectInput(), selectOutput(), selectFolder() or something like that.

(System filedialog looks more profesional and nicer Smiley)
Re: how i get Directory chooser window ?
Reply #3 - May 26th, 2010, 4:26am
 
There is no AWT (ie. native) implementation of folder chooser, except in the Apple implementation of Java...
selectFolder() is nearly the only usage of Swing (ie. of JFileChooser) made in Processing. It uses Apple's native chooser if on Mac, but it uses JFileChooser on other platforms.
If you target one platform only (or are ready to handle several ones), you can implement the system calls yourself, with JNI or JNA...
Page Index Toggle Pages: 1