I have a program where I have a settings button. This button has an image icon which shows an image. Any tips on how I can preform an action when it is pressed. Here is that code
JButton imageButton = new JButton(new ImageIcon("/Users/Sam/Programming/Files/gears.png"));
It works fine. But when I want to use
else if(ae.getActionCommand().equals(imageButton)){//doStuff}
it doesnt work. My action preformed method works, here it is
public void actionPerformed(ActionEvent ae)
{}