- Where Developers Learn, Share, & Build Careers
I'm curious about what the most effective way to read the text file (do not worry about size, it's quite a lot Is e.g. Can I completely consume any file in a string and then use it to display You can use and pass it. Just do this: Java 7 - Attempt-processing block Java 6 - try-end block java.io OK) and then put its contents in the display for a JTextArea . JTextArea.setText or I should read lines from line or byte arrays and give them stringbuffers Should be populated in and then setting the text area that
(file reader reader = new file reader ("myfile.txt ")) {TextArea.read (Reader, blank); }
FileReader reader = null; Try {Reader = new FileReader ("myfile.txt"); TextArea.read (reader, tap); } Finally {if (reader! = Null) {reader.close (); }}
Comments
Post a Comment