I had done it successfully using Netbeans in this example:
https://coderanch.com/t/565811/GUI/java/Newbie-just-trying-change-icon
But now, I switched to Eclipse (using the WindowBuilder Pro plugin). It generates a method stub, which I filled with
JLabel lblJlabela = null;
lblJlabela.setIcon(new ImageIcon("J:\\Eclipse Folder\\Eclipse1GUI\\Photos\\Viper3.jpg"));
I had to add the first line of that because it was telling me that lblJlabela was "unresolved"...it auto-suggested that I do that. But here's the whole program.
It runs and displays a jFrame with the two initial photos, but when I press my mouse over "LabelA", nothing happens. It gives these message in console:
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
How can I get it to work so that I change images in that jLabel?