Reputation: 11
I created the textarea on the form on which I am working but don't know how to display the contents of text file in jtextArea in netbeans7.0
Upvotes: 1
Views: 912
Reputation: 3761
I saw this suggestion on another question earlier: Use the read() method of JTextComponent.
textArea.read(new FileReader(textFile), "here's a description of the file");
Upvotes: 3
Reputation: 23629
If you have a JTextArea, just call setText(String yourText)
to populate it.
Also see the tutorial: http://download.oracle.com/javase/tutorial/uiswing/components/textarea.html
Upvotes: 0
Reputation: 13413
This has nothing to do with Netbeans 7.0. In Java this is how you set text to a JTextArea
:
jTextAreaInstance.setText("myText");
Upvotes: 0