Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JOptionPane.showInputDialog() misspelled

 
Bat Gang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Starting Java and can't seem to get j option pane to work, followed a tutorial on YouTube to help and done everything the exact same and an error is still appearing.
Error is on line 10: cannot find symbol method showInputDialogue(java.lang.String)
Was wondering if anyone could help.
Thanks

YouTube Link: http://www.youtube.com/watch?v=E3JQrxxQKIo

Image of code attached
example.png
[Thumbnail for example.png]
Code
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have another look at the video and check the spelling of that method name.
And if it's spelt the same in the video, then it's an error. You can find the correct method name in the javadoc - JOptionPane
 
Bat Gang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea everything is spelled right, i am kinda new to java so that document is really not much use to me, don't understand much of it, i was just wondering if you knew why mine was showing an error and the one on the video wasn't?
Thanks.
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bat Gang wrote:Yea everything is spelled right . . .

No it's not. It's not event spelled like you wrote it in the video you posted. Here you have the exact name of the method: JOptionPane#showInputDialog.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49733
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:Have another look at the video . . .
No, Joanne, I would recommend avoiding that video like the plague. There are lots of good tutorials available and that ain’t one of them, because:-
  • 1: It is old, using JDK1.4
  • 2: It only shows one method, not mentioning its overloadings, nor the other option pane methods.
  • 3: There are formatting problems in the code, ie long lines, inconsistent indentation and inconsistent use of {}.
  • 4: The commentary mentions a JOptionPane “object”, appearing not to realise that is a static method and no such object exists. It even changes from object to class within two sentences.
  • They do however spell the method name correctly.
     
    Joanne Neal
    Rancher
    Posts: 3742
    16
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Campbell Ritchie wrote:They do however spell the method name correctly.

    That was the only reason I suggested watching the video again, because the OP had erroneously claimed that he had
    done everything the exact same

    I haven't actually watched the video, so couldn't comment on it's quality.
     
    Campbell Ritchie
    Sheriff
    Pie
    Posts: 49733
    69
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Joanne Neal wrote: . . . I haven't actually watched the video . . .
    You haven’t missed anything

    Trouble is, anybody can post a tutorial and nobody corrects it. If I post rubbish here, there are lots of people, yourself included, who will set me right. Which is one of the reasons fora like this are better than tutorials.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic