• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing Input Example  RSS feed

 
Damien O Sullivan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an Input Box in which the user is supposed to enter the answer to a sum, when the answer is equal to the correct answer I want to show a MessageBox that tells them they've got it correct.

But when I run the project it crashes saying it 'cannot find symbol', I'd like to know if any of you could help me with this problem. Thanks!

Heres the code too:

 
Damien O Sullivan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Damien O Sullivan wrote:Hi,

I have an Input Box in which the user is supposed to enter the answer to a sum, when the answer is equal to the correct answer I want to show a MessageBox that tells them they've got it correct.

But when I run the project it crashes saying it 'cannot find symbol', I'd like to know if any of you could help me with this problem. Thanks!

Heres the code too:



Also, it crashes on line 43
 
Paul Clapham
Sheriff
Posts: 22506
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have a compiler error, which means you can't run the code at all yet. Aren't you using some tool which tells you about those things?

Anyway if it's line 43, then it's referring to the symbol "jOptionPane". The error message says that symbol isn't declared anywhere, and certainly I don't see anywhere where you declare it. Perhaps you meant to use the class name "JOptionPane" instead? That isn't the same symbol, because Java is a case-sensitive language, which means that for example "Paul" and "paul" are different variable names.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!