So I want to replace an ImageIcon in a JLabel every time a button is pressed. I made it so the image, label, and GridBagConstraints are public. When I try to change it thoug
Rather then trying to create and add a new label each time, simply call setIcon
on the label itself
Something more like...
image = new ImageIcon(imageList[1]);
label.setIcon(image);
Check out How to use lables for more details.
I might also suggest that you load the images first, so you don't need to keep reloading them/creating new objects on each actionPerformed
I'd also recommend ImageIO over ImageIcon