• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help with compiler error  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just not learning how to get input from dialog boxes. However, every code I write I get an error message for this part of the code.

Example:

String firstNumberString = JOptionPane.showInputDialog(null,"Enter first number","Assignment2_main",JOptionPane.QUESTION_MESSAGE);

Error: cannot find symbol
Error: cannot find symbol

I have also found that if I put another ) after MESSAGE I get less error messages but the error message then says

Error: ';' expected

But I already have a ;

I am very confused and help would be much appreciated. Also I don't know if you would actually need to see more of the code to figure out the problem but I would be more than happy to post it. Thanks in advance!!!
 
Ranch Hand
Posts: 210
Ruby Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you have import statement to import the JOptionPane?

It will be more helpful if you can post the detail error message and your code.
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wirianto Djunaidi is quite correct; please provide more detail and the likeliest cause is failure to import JOptionPane.

But, less of that and more of . . . welcome to JavaRanch
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!