Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

issue with - "cannot find symbol - variable JOptionPane"

807589Dec 13 2008 — edited Dec 13 2008
need some help, got the below loop and want it to be able to loop by the number input by the input dialog. when i compile it i get an error in BlueJ. the error is "cannot find symbol - variable JOptionPane". Any help. have tried a few things however cannot get this to work at all. any suggestions?

public void numberLoop()
{
String qA = JOptionPane.showInputDialog(null,"How many times should this be completed (e.g. 1,2,3,4)?","Question",JOptionPane.QUESTION_MESSAGE);
int qA2 = Integer.parseInt(qA);

for (int startNum = 1; startNum <= qA2; startNum++)
{

System.out.println(startNum + " squared is " + (startNum * startNum));
}

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2009
Added on Dec 13 2008
1 comment
3,380 views