In Java Swing, is there a quick way to change the icon of whichever button was pressed without having to write it separately for each button. Something like
event.getSource().setIcon( icon );
But this came up with a "cannot find symbol" error. Is there a way to do this?
Thanks in advance