Java won't let me do this declaration!
When I try to add the string argument I keep getting the error:
errorMessage(java.lang.String) in ProjectFile cannot be applied to ()
Code:
public static void errorMessage(String defineError) {
JOptionPane.showMessageDialog(null,
"There is an error in the account file!\n" +
"Please contact your branch to resolve this problem." +
defineError, "Banking Error:", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
This is kind of urgent, so any help would be greatly appreciated :)
Re: Java won't let me do this declaration!
This code is working fine for me
Code:
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
Main.errorMessage("Error Message");
}
public static void errorMessage(String defineError) {
JOptionPane.showMessageDialog(null, "There is an error in the account file!\n" + "Please contact your branch to resolve this problem." + defineError, "Banking Error:", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
}
I don't know what seems to be the problem