Board index » jbuilder » How to read file names?

How to read file names?


2005-07-05 06:56:25 AM
jbuilder6
Hi.
I would like to know which is the process to read from a directory I pass to
my function, all the files in that directory and put them in
a table, one row per file with its name.
Thanks
 
 

Re:How to read file names?

Something like:
File[] files=new File(dir).listFiles();
for (int i=0, l=files.length; i<l; ++i) {
tableModel.add(files[i].getName()); // or something like that
}
- Alexey.
Anton wrote:
Quote
Hi.

I would like to know which is the process to read from a directory I pass to
my function, all the files in that directory and put them in
a table, one row per file with its name.

Thanks


--
Alexey N. Solofnenko
home: trelony.cjb.net/