0
FileReader readKGN = new FileReader("KGNLibrary.txt");

                int KGNLib = readKGN.read(); 

                readKGN.close();

i dunwan read it as int.. because i wan use it on IF, so i need it to compare wat i input string item into text area with text file inside string item.

if (POS[i].equals(KGNLib))
            {
                jTextArea2.append((POS[i] + "/KK" + " | "));
3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by rrusin
0

Read the API docs for FileReader and see if some other method there is better.

Or wrap it in a BufferedReader, then read the API docs for BufferedReader and see if there is yeat another method there that is even better for your purposes.

0

You can use commons io (http://commons.apache.org/io/api-release/index.html), like this:

IOUtils.toString(inputStream)

Java is not a superior language itself, but it has a lot of great external libraries.

Regards,
<<snip>>

Edited by Nick Evan: Do not spam, advertise, plug your website, or engage in any other type of self promotion.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.