Solved

Work-around for 4500 word textarea limit

Posted on 1997-06-23
4
217 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet doXXX methods 3 49
windows explorer path to command prompt 5 43
xampp tool 12 48
fibonacci ten numbers 4 38
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

776 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