Solved

Work-around for 4500 word textarea limit

Posted on 1997-06-23
4
202 Views
Last Modified: 2011-10-03
I'm bumping into a 4,500 word/29,395 character limit in my java textarea.  Is there a work-around that would allow me to put more stuff in my java text-areas .. ie. a web-page of material totaling 60,000 + characters?

Thanks so much!
0
Comment
Question by:askrinsky
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
jpk041897 earned 100 total points
ID: 1222011
Back in the days of CPM (I know, ancient history :-) ) Wordstar came up with a Word proccesos that could run on 8K give you a (for then) amazing 40K work space. What was even more amazing, was that you could process a file that was over 360K long! (Well, that was a lot back then).

The way that WS did it should also work well for you.

As long as the text fits in memry, Create 2 Strings, One will contain the total text and the other one will contain a window into the text.

Maintain an int pointer that will allow you to call substring, to extract text from the main text string and store it in the window text (by window, I mean a window int the large text buffer, not an actual window).

Display the contents of the String window on to your textArea. (If you are going to do heavy edditing on the text, set up the window string to contain arround 2/3 of the available space).

Subclass the scroll bars and the appendText()/insertText() methods so that you know when you have reaches the top/bootom of the string window and can store/read another section of the main text. And count the number of characters appended/inserted. When you are close to the textArea limit, append/insert the changed text into the main text buffer.

Its a lot of work but not particularly difficult.

removing text can be handled by obtaining the length() of the window String at the time you load and store a text window. If the values are diferent, or a flag is set by the append/insert methods, you know you will have to replace the section of the main text buffer that was mapped on the text window with the text contained in the window .

Hope this answers your question.
0
 

Author Comment

by:askrinsky
ID: 1222012
(Edited by Computer101) that looks like a pain.  But thanks for your keen insights.

Why the limit anyway?  What's your read?

Thank you so much,

Anthony
0
 

Author Comment

by:askrinsky
ID: 1222013
Does the limit apply in JavaScript too?  I think it does unfortunately... what to do then?
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1222014
>Why the limit anyway? What's your read?

The limits existance is not Java's fault, but the undering plattforms. (Windows to be precise).

Remember that allmost all of the AWT is handled by peer classes, which translates to native calls. When MS designed Windows (back in the days of Win 2.0) they figured that an upper limit of 32K was more then enough for an edit window. In those days memory models only allowed you 64K total for the data section of your program.

Of course, MS never figured on the future growth of hardware (no news here). Unfortunatley, MS's solution to the problem was the Rich Text edit control, which is not portable to other platforms.

Sun was therfore forced to choose between not porting for Windows or limmiting textField size for all plattforms. The market sort of forced a desition there.

>Does the limit apply in JavaScript too? I think it does unfortunately... what to do then?

Yes it does.

You can use Live Connect and let the applet handle the buffering for you
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now