Results 1 to 5 of 5
Thread: List directory
- 08-20-2009, 06:22 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 5
- Rep Power
- 0
- 08-20-2009, 07:07 PM #2
Java Code:File file = new File("c:/"); //or where ever you like File[] files = file.listFiles(); for(File f : files) { System.out.println(f); }
- 08-21-2009, 12:36 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 5
- Rep Power
- 0
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.
- 08-21-2009, 01:32 AM #5
Member
- Join Date
- Aug 2009
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Populating a gui list box with the files in a directory
By josejvelezcolon in forum New To JavaReplies: 1Last Post: 08-10-2009, 04:50 PM -
Linked List integer list
By igniteflow in forum Advanced JavaReplies: 1Last Post: 12-10-2008, 08:53 PM -
How to access ArrayList in List of List?
By alvations in forum New To JavaReplies: 5Last Post: 10-08-2008, 12:23 PM -
how to list certain files in a given directory in java
By corpusluteum in forum New To JavaReplies: 6Last Post: 09-24-2008, 12:19 AM -
How can I get list of files in a directory
By karma in forum New To JavaReplies: 2Last Post: 12-14-2007, 11:20 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks