I've been given a practical to do, and it comes with a ImageEditor file which I can show if needed however it's lengthy so I've not posted it on here.
I have to implement a save link and have been given the code which I have stored in a separate class file:
public class SaveAction extends AbstractAction{
public SaveAction(String text, ImageIcon icon, String desc, Integer mnemonic){
super(text, icon);
putValue(SHORT_DESCRIPTION, desc);
putValue(MNEMONIC_KEY, mnemonic);
}
public void actionPerformed(ActionEvent e){
// Just print out a message for now.
System.out.println("Save");
}
}
And then creating an instance in the main class:
Action saveAction = new SaveAction(
"Save", new ImageIcon("img/save.png"), "Save the image", KeyEvent.VK_S);
However it is coming up with the error:
The Constructor SaveAction(String, ImageIcon, String, int) is undefined.
Any help would be greatly appreciated
Integerbut is passed anint. I am surprised auto-boxing does not take care of that.