Results 1 to 2 of 2

Thread: Java won't let me do this declaration!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    71

    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

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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
    Last edited by ComputerJy; Oct 10th, 2007 at 02:49 PM.
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width