Results 1 to 5 of 5
Thread: Text IO class
- 02-22-2009, 04:09 AM #1
Member
- Join Date
- Feb 2009
- Posts
- 5
- Rep Power
- 0
Text IO class
Hi,
I am new to Java and am trying to use the TextIO class in my code. I have Java6 open sdk running on eclipse 3.4.1 .. However, when I try to use TextIO, I get a "TextIO cannot be resolved" error.
Can you please help ?? I thought TextIO was built in for every version of Java over Java5 .. Am I doing something wrong ?? Here is some of the sample code I pulled from the internet to try out.
TextIO.writeUserSelectedFile(); // If user cancels, output automatically
// goes to standard output.
TextIO.putln(words.size() + " words found in file:\n");
TextIO.putln("List of words in alphabetical order"
+ " (with counts in parentheses):\n");
for ( WordData data : words.values() )
TextIO.putln(" " + data.word + " (" + data.count + ")");
TextIO.putln("\n\nList of words by frequency of occurence:\n");
for ( WordData data : wordsByFrequency )
TextIO.putln(" " + data.word + " (" + data.count + ")");
System.out.println("\n\nDone.\n\n");
-
So what is the TextIO class and where did you find this? Was it given to you by your teacher? I ask because it's not part of the standard Java library.
- 02-22-2009, 04:33 AM #3
Member
- Join Date
- Feb 2009
- Posts
- 5
- Rep Power
- 0
I was trying this one from google. If you google TextIO.java, I picked up the first one the results gave me. But it doesnt seem to work :(
Basically what I am trying to do is write a program that can give me the 10 most common and the 10 least common words from a text file. I am having major trouble doing this. It would be awesome if you could help. :)
Thank you.
- 02-22-2009, 04:47 AM #4
Member
- Join Date
- Feb 2009
- Posts
- 5
- Rep Power
- 0
Okk .. I just read my post again .. I forgot to mention TextIO and TextReader are non-standard classes that I have been instructed to use when writing this program.
I have googled the two and use them as classes in 2 different packages that I have imported into my program. Even so, my program does not compile and keeps giving me objoct not found, or method not found errors :( ..
Please HELP !!
Thanks
-
Since they're non-standard, and we don't have an API that we can refer to, we may not be able to help much. For instance, you're using the class's methods as if they are static. Do you know that they in fact are static? If not, have you tried creating an object of the class and calling the methods from the object? If this or other's posts don't help you, you may need to speak with your instructor.
Similar Threads
-
passing text from a class to a gui class
By rob in forum AWT / SwingReplies: 2Last Post: 02-13-2009, 11:04 PM -
Class to store Image+Text
By Gudradain in forum New To JavaReplies: 2Last Post: 11-23-2008, 08:32 AM -
How to use TextAttribute class to obtain underlined and striked through text
By Java Tip in forum java.awtReplies: 0Last Post: 06-25-2008, 10:34 AM -
How to use TextAttribute class to change color and font of a text
By Java Tip in forum java.awtReplies: 0Last Post: 06-25-2008, 10:33 AM -
Edit JPanel Text During Runtime...from another class
By bdn1404 in forum New To JavaReplies: 5Last Post: 08-11-2007, 03:14 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks