I'm using a custom listcellrenderer with a list and setting both a title and an image but it's really laggy because the image keeps loading everytime i scroll. Is there any way i can fix this ? Here is my code:
@Override
public Component getListCellRendererComponent(JList<? extends Movie> list, Movie value, int index, boolean isSelected, boolean cellHasFocus) {
this.titleHolder.setText(value.getTitle());
this.imageHolder.setIcon(new ImageIcon(value.getPoster()));
return this;
}
I basically want the image to stop loading everytime i scroll through the list because it's causing the app to lag really heavly. Thanks in advance.