I am on the second part of pergesu's tutorial on Java and I have run into a roadblock.
I correctly typed in notepad the sourcecode for the
If.Java application and I got an error.
So, after that I decided to copy the source staright from the tutorial and save it and then try. Same problem. This is the source :
// If.java
import javax.swing.JOptionPane;
public class If
{
public static void main(String args[])
{
int num1, num2;
String number1, number2;
number1 = JOptionPane.showInputDialog("Enter the first integer");
number2 = JOptionPane.showInputDialog("Enter the second integer");
num1 = Integer.parseInt(number1);
num2 = Integer.parseInt(number2);
if(num1 > num2)
{
JOptionPane.showMessageDialog("num1 > num2");
}
System.exit(0);
}
}
I get this error message :
C:\Java>javac If.java
If.java:19: cannot resolve symbol
symbol : method showMessageDialog(java.lang.String)
location: class javax.swing.JOptionPane
JOptionPane.showMessageDialog("num1 > num2");
^
1 error
Before I posted I looked at the error message and tried to decipher what it meant. I figured that since the pointer ( ^ ) was pointing towards the period (.) in that specific line of code something was wrong. But, I don't understand why that would cause a problem. Any help would be appreciated.
Thanks,
Crackle
Edit : Since the quote's pull everything to the left side of the page it looks as if the ^ is pointing at the "J". It is not, it should be pointing toward the period in this line of code :
JOptionPane.showMessageDialog("num1 > num2");
---------------^