Is there a way to store data in a JButton?
My program currently adds an image to a List, which it then creates a Jbutton dynamically storing a thumbnail. Like found here . although the images are added as the user selects them. The issue I am having is that I cannot get the image to change to the thumbnail that is selected as they are not linked to the images in the list. Is there a way I can store the index number of the image in the button, so when I click it I know which image to show in the List? Or is there another more intelligent way? Thanks. //Create thumbnail private void createThumbnail(ImpImage image){ Algorithms a = new