Hi
I'm kinda new to java and i was wondering how can i list a local or a remote directory on a JList or something like that.
Thank you for your time.:)
Printable View
Hi
I'm kinda new to java and i was wondering how can i list a local or a remote directory on a JList or something like that.
Thank you for your time.:)
Code:File file = new File("c:/"); //or where ever you like
File[] files = file.listFiles();
for(File f : files)
{
System.out.println(f);
}
do you know how can i list the directory on a jList ? :confused:
Thanks!
Once you have the array, the rest of the problem is to put it into a JList. This tutorial will help with this: How to Use Lists
If you go through the tutorial and still have problems, then you'd be best served to post your code (with code tags) and we can help figure out any areas of misunderstanding.
Much luck.
ok thanks for the help, i'll check the list tutorial...