I have an initialize in my UI, and I am trying to read in a file of already existing videos from my video manager below. So when I start my GUI the list should be populated in the GUI. Any ideas? Where am I going wrong?
and my Video Manager:
Code:
public void initialize()
{
myList.setListData(VideoManager.getInstance().getVideos().toArray());
int size = myList.getModel().getSize();
}
and my Video Manager:
Code:
public List getVideos()
{
if (videos == null)
{
videos = new ArrayList();
inFile = new Scanner("/home/VideoFile.csv");
while ( inFile.hasNextLine())
{
line = inFile.nextLine();
System.out.println(line);
Scanner tokens = new Scanner(line);
}
inFile.close();
}
return videos;
}