Questions about JFileChooser

I don't want the user to select a file to open, I want them to select a directory to SAVE a file in. Yeah do i have to use a different function besides JFileChooser or do I just have to use some parameter?

Also, say you have a file called THEFILE, is there a way to check and see if there are any other files that are named that in the directory?

[360 byte] By [Lateralus01a] at [2007-11-26 22:20:21]
# 1

Use the [url=http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFileChooser.html#setFileFilter(javax.swing.filechooser.FileFilter)]setFileFilter()[/url] method. You need to create a subclass of [url=http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/filechooser/FileFilter.html]FileFilter[/url] that implements the [url=http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/filechooser/FileFilter.html#accept(java.io.File)]accept()[/url] method the way you want it to.

CaptainMorgan08a at 2007-7-10 11:17:16 > top of Java-index,Java Essentials,New To Java...