• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difficult: Large File for JTextArea?

 
RichardLeeOne
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many software written in C++ out there which can handle large file. It seems that there have been no information on any Swing books about trying to load large files (over 10MB-20MB) into a JTextArea using kits or whatever and they have all had the same problems but I couldn't find a solution.
Some common problems, when loading the large files, are:
Large amounts of memory use (sometimes entire file cannot be loaded)
Loading takes a long time
I too am trying to make a text editor that reads RTF or plain text but it needs to be able to handle large files, but I could not find a solution.
What can I do to overcome this problem?
Are there certain ways of initializing components?
Is javax.swing.text.ZoneView a possibilility? How is it used? What other possibilities are there?
I am using the latest SDK, 1.4.2. I appreciate any info regarding the subject.

Any code sample is much appreicated.
mail: richardlee2061@yahoo.com
Thanks!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"cool JavaOne" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
 
RichardLeeOne
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I changed that. Thanks for your reminding.
Any solution for this thread?
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Richard,
Just a suggestion (in case you are unaware of it).
jEdit is an open-source editor written in java. Perhaps looking at their source code will help you?
Good Luck,
Avi.
 
RichardLeeOne
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I read JEdit source code some time ago, and actually it does not help much, because they still hold all the document in the memory actually before display. I am hoping that we can load the document page by page, or by caching only few # of pages in memory, just like some commercial Editor in C++.
Any idea?
[ July 21, 2003: Message edited by: RichardLeeOne ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!