Populating a gui list box with the files in a directory
I need to populate a list box with the names of a directory files.
For example
I have a folder called x. In that folder there is the following files
1.csv
2.csv
3.csv
Now I need to populate the my gui list box to populate fields with
1.csv
2.csv
3.csv
Here is my code so far
Public class dir{
File folder = new File("c:/mydocument/");
File [] listofFiles=folder.listFiles();
}
Now that I have the lisofFiles
how do i pass the values to my main gui class
An example code would be greatly apreciated.
}