Hi all, I have a task which involves opening a Java Source file into a text area. Iam trying to use the Input and Output streams to do so. Will this work out? If so could anyone please tell me how. How should I use the Inputstream to capture the contents of the file and then How should I Display the contents in a text area. Later on I should be able to modify the contents of the text area. Can anyone please tell me how to do this? Thanx Parwez
Carl Trusiak
Sheriff
Joined: Jun 13, 2000
Posts: 3340
posted
0
Here is an example that's available with JBuilder 3.0.
here's solution for u try{ BufferedReader in = new BufferedReader(new FileReader(filename)); while((str=in.readLine())!=null) textarea.append("\n"+str); in.close(); }catch(IOException e) {textarea.setText(e.getMessage());} this much will work. harish