JList

Hi there,

I'd like to here from you if there is any way to use the JFileChooser to also act the same way for directories. I would like to be able to not only add a file path to a JList once a "Add" JButton is pressed and opens the JFileChooser, but also if there is a directory to add then enable the FileChooser to add it instead of opening the folder?

Thanks

[380 byte] By [tarmenela] at [2007-11-27 10:57:02]
# 1

> I'd like to here from you if there is any way to use

> the JFileChooser to also act the same way for

> directories.

act in what way? It can select directories. Read the docs.

CeciNEstPasUnProgrammeura at 2007-7-29 12:06:31 > top of Java-index,Java Essentials,Java Programming...
# 2

Apologies for wasting your time. I found this:

fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

It did the trick

tarmenela at 2007-7-29 12:06:31 > top of Java-index,Java Essentials,Java Programming...
# 3

What I'd like to check with you is if its possible to keep the JFileChooser open until I have finished adding all the required files? At the moment I'm using button to open the JFileChooser but I don't want to have to push the button but rather keep it open till I've done adding files.

tarmenela at 2007-7-29 12:06:31 > top of Java-index,Java Essentials,Java Programming...