I have an arraylist of object with the properties Title, Director, Rating, and the pathname for an image. I am wanting dynamically fill the JTable with this data in a for loop as illustrated by the following pseudo-code:
for(int i = 0; i < movieCatalog.size(); i++)
{
imageCell = movieCatalog.get(i).getImagePath();
titleCell = movieCatalog.get(i).getTitle();
directorCell = movieCatalog.get(i).getDirector();
ratingCell = movieCatalog.get(i).getRating();
}
So for each slot in the arraylist I want to put the data into their respective cells in each row.
How do I put the image into each cell?. I understand that I need to set up an image render but I don't know how to do this. Code for adding data to the table, and the image renderer would be much appreciated.