Array to ArrayList.
in
Programming Questions
•
1 month ago
I'm having a problem to convert an array to a array list.
When I use:
" listOfFiles = new ArrayList<File>(Arrays.asList(Folder.listFiles())); "
It keep showing: "Cannot find anything named "Array"", wich makes me think that Processing don't have any Arrays class, as in Java:
( http://stackoverflow.com/questions/157944/how-to-create-arraylist-arraylistt-from-array-t)
Btw, listOfFiles = Folder.listFiles().asList(); also give me that error message "Cannot invoke asList() on the array type File[]"
There's another way to do that?
When I use:
" listOfFiles = new ArrayList<File>(Arrays.asList(Folder.listFiles())); "
It keep showing: "Cannot find anything named "Array"", wich makes me think that Processing don't have any Arrays class, as in Java:
( http://stackoverflow.com/questions/157944/how-to-create-arraylist-arraylistt-from-array-t)
Btw, listOfFiles = Folder.listFiles().asList(); also give me that error message "Cannot invoke asList() on the array type File[]"
There's another way to do that?
1