Trouble with Integer.parseInt(inputString) in Swing
807598Oct 15 2006 — edited Oct 31 2006I have JDK1.6.0 and JDK1.5.0_08 with corresponding run times.
IDE: Dr. Java 20060821-1502 which indicates that jdk1.6.0 is in use.
java.class.path C:\Program Files\DrJava\drjava-stable-20060821-1502.exe; C:\Program Files\Java\jdk1.6.0\lib\tools.jar
java.home C:\Program Files\Java\jre1.6.0
When typing in examples from various JAVA books, when the example uses a line like:
int age = Integer.parseInt(stringInput);
It won't compile in Dr. Java or from command line javac ...
error message points to Integer and states symbol not found
My modification to get examples to compile and run:
String myInput;
int monthNumber;
myInput = JOptionPane.showInputDialog("Type in the number" + " of the Month:");
monthNumber = (int) Long.parseLong(myInput);
when I use Long and cast it to int, it works.
Where would I look to discover the contents of the library or class that contains Integer.parseInt()?