Results 1 to 3 of 3

Thread: What is this error I am missing?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    19

    What is this error I am missing?

    I'm fairly new to Java, but am I missing a very simple error here? when opened in Textpad, i'm getting this error.

    C:\Course Technology\85983-4\Chapter04\Errors.java:37: cannot find symbol
    symbol : method showMessageDialog(<nulltype>,java.lang.String,java.lang.String,java.lang.String,int)
    location: class javax.swing.JOptionPane
    JOptionPane.showMessageDialog(null, "Your ending mileage,",endMiles +", must be greater than your starting mileage, " + startMiles, "Error in Mileage", JOptionPane.ERROR_MESSAGE);
    ^
    1 error

    Tool completed with exit code 1
    Last edited by Squirrel RJ; Feb 16th, 2006 at 08:28 AM.

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: What is this error I am missing?

    Check the method signatures of the JOptionPane. If I have more time this afternoon, then I'll help you out more, but I'm getting ready to leave.

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

    Re: What is this error I am missing?

    Your code should be:
    Code:
    JOptionPane.showMessageDialog(null,
                                      "Your ending mileage," +
                                      Integer.toString(endMiles) +
                                      ", must be greater than your starting mileage," +
                                      Integer.toString(startMiles), "Error",
                                      JOptionPane.ERROR_MESSAGE);
    "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