This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes DirectoryChooser - How? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "DirectoryChooser - How?" Watch "DirectoryChooser - How?" New topic
Author

DirectoryChooser - How?

Em Aiy
Ranch Hand

Joined: May 11, 2006
Posts: 226
I want to open a "DIRECTORY CHOOSER" instead of JFileChooser so that user may choose the destination directory for output. how can i?


The difference between <b>failure</b> and <b>success</b> is often being <b>right</b> and being <b>exactly right</b>.
Davy Kelly
Ranch Hand

Joined: Jan 12, 2004
Posts: 384
I found this for you.
http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html

so JFileChooser could be a good tool to use.

davy


How simple does it have to be???
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
perhaps all you need to do with your current JFileChooser is this

fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
 
GeeCON Prague 2014
 
subject: DirectoryChooser - How?