Be aware that java.util.Scanner is only since 1.5. If you are using this version of Java, or later, consider nextInt rather that just readLine, as well. If you are using an earlier version of Java, check out java.io.BufferedReader. And it's never a bad idea to study the IO tutorial:
I have 1.4.2 hency why the scanner wont work. I can load and save text files with no problem. What i am doing now is take the text in the jTextArea and puting it in a String. But i dont know how to put those 6 numbers from the string into an array. Any help will be appreciated.
Joined: Jan 24, 2006
i think versions before 1.5 have scanner. but to create the object
requires different syntax... like
Scanner scan = Scanner.create(file);
and in the while loop i made a boo boo, don't let info += scan.nextLine,
only info = scan.nextLine();
and you could declare info to be an int, and say.
info = scan.nextInt();
wasn't thinking i guess.
and you have to import the scanner package.
so before the...
I lied!! the Scanner scan = Scanner.create(); only applies to the first
beta of java 1.5... sorry!
-Justin- [ May 03, 2006: Message edited by: Justin Fox ]