🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3454

Re: TextEdit example will not always display entire file.

#3454
From: Rich Downing
Date: Fri, 19 Dec 1997 00:00
85 lines
3198 bytes
Seems this is a known bug. Following is from Sun bug page:

------
Bug ID: 4080391 which states:

Summary: general:classes_awt, TextArea.setText()TextArea.setText()
doesn't work for large Strings.,

State: In progress, bug, Reported: Sep 19, 1997, Release reported
against: 1.1.4 1.1.5
-----

Seens also not to work on the copy of the 1.1 version of Java.  I
guess I'll just have to wait. <G>

Rich


On Sat, 13 Dec 1997 19:42:38 GMT, rvd@mindspring.com (Rich Downing)
wrote:

>While using the Borland TextEdit example I noticed that the program
>would not always display the full contents of a text file.
>
>For example, I have a text file of 73,728 bytes which will not display
>at all.  If I remove some of the data such that the file size becomes
>53,248 bytes some of the file will display, and then some extraneous
>characters will display (which display as square boxes), after which
>the file display is truncated.  if I reduce the file size still
>further, the file will display correctly.
>
>In the example, I created an intermediate string so that I could print
>it to the Java console.  It prints out fine.  The problem seems to lie
>with the textArea1.setText(s) command.
>
>The same results occur using jre, jrew, java, javaw, and while running
>in debug mode.
>
>This occurs on Win 95 on a P100 with 64 meg, and also on Win 98 Beta 2
>refresh on a P150 with 80 meg.
>
>I could email the data file, or make it available on my ftp site if
>anyone is interested.
>
>The data in the character array and the string are ok.  The code
>snippet follows:
>
>--------------
>
>char[] data = new char[size];
>
>while (in.ready())
>         {
>         chars_read += in.read(data, chars_read, size - chars_read);
>         }
>
>in.close();
>
>String s = new String(data, 0, chars_read);
>System.out.print(s);
>
>//       textArea1.setText(new String(data, 0, chars_read));
>textArea1.setText(s);
>
>-----------------
>
>Any ideas, guys????
>
>Rich
>
>
>----------------------------------------------------------------------
>Richard V. Downing              Work email: richard.downing@vsin.com
>Senior Software Engineer        Home email: rvd@mindspring.com
>VideoConferencing Systems, Inc. Web: http://rvd.home.mindspring.com
>Norcross, Ga
>------------ When surrounded by wolves 'tis best to howl -------------

----------------------------------------------------------------------
Richard V. Downing              Work email: richard.downing@vsin.com
Senior Software Engineer        Home email: rvd@mindspring.com
VideoConferencing Systems, Inc. Web: http://rvd.home.mindspring.com
Norcross, Ga
------------ When surrounded by wolves 'tis best to howl -------------
Technical Details
Message-ID: <349a9f05.6796561@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3492e23f.8340793@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,109b2266779bfe35
X-Google-Attributes: gid1089d0,public
From: rvd@mindspring.com (Rich Downing)
Subject: Re: TextEdit example will not always display entire file.
Date: 1997/12/19
Message-ID: <349a9f05.6796561@forums.borland.com>
X-Deja-AN: 308600386
References: <3492e23f.8340793@forums.borland.com>
Organization: None
Newsgroups: borland.public.jbuilder.java.api