aspose file tools*
The moose likes Beginning Java and the fly likes Populating a TextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Populating a TextArea" Watch "Populating a TextArea" New topic
Author

Populating a TextArea

Ian Cockcroft
Greenhorn

Joined: Feb 17, 2002
Posts: 29
Hi everyone,
I didnt know if this is more appropriate to I/O, Swing or where, so I thought I'd post here.
I am trying to populate a TextArea component from a text file. I seem to be getting some errors.
How would u do it?
Some suggestions please.
Regards
Ian
my code so far.

This compiles and runs, but doent populate the TextArea component?
[ April 22, 2002: Message edited by: Dirk Schreckmann ]
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Worked for me. Are you sure it finds the file?
Ian Cockcroft
Greenhorn

Joined: Feb 17, 2002
Posts: 29
Hi Paul, thanks for the swift reply.
It finds the file and compiles and runs, but there is no text in the TextArea. There is deffinitly text in the file.
Thanks again
Ian
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Hello Ian,
It works for me as well after I make the necessary changes to get it to compile.

Are you certain that it is finding the file you are specifying? If you are and it still doesn't work for you, what happens if you place the file in the same directory as your compiled class file(s) and if you create your FileReader accordingly:
FileReader charRead = new FileReader("TestText.txt");
Does it still not work?
Good Luck.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Populating a TextArea
 
Similar Threads
problem in JTable
JScrollPane: Change of the size of content
JTextArea As JRadioButton
Can't bind JComponent location to Jlabel text property
jframe not accepting sql query..