[5407] in java-interest

home help back first fref pref prev next nref lref last post

Re: Text Area bug

daemon@ATHENA.MIT.EDU (Walter Szewelanczyk)
Thu Feb 8 00:43:41 1996

From: "Walter Szewelanczyk" <Walter@adco.com>
To: Kenneth Lum <kinlum@hooked.net>, java-interest@java.sun.com
Date: Wed, 7 Feb 1996 23:37:57 +0000

Hi Kenneth,

On   Wed, 07 Feb 1996 04:51:55 -0800     Kenneth Lum  wrote : 

> It seems that replaceText() for the TextArea class has a bug
> of "inserting" text rather than replacing.
> For example, if in addition to other call to replaceText() in
> a loop I add:
> 
>  ta.replaceText("1234567890", 0, 9);
>  ta.replaceText("A", 0, 0);
> 
> Then the beginning of the text area shows at first
> 
> "A234567890", but then next time it begins to show something weird like
> "AA23456789090" -- something like that -- it seems to be inserting
> a couple of extra characters, in other words.
> 
> Does some one know?  Is it a known bug?
> 
> Thanks,
> -- Kenneth
>

The documentation is not clear on this but when you set the end value 
for the replaced text it is not inclusive  for instance if you had 
the string "0123456789" and the called replaceText("ABC",2,4)
the new string would be "01ABC456789"  It did not replace the 4 just 
23.  

When you called replaceText with 0,0  it did not replace any text it 
just inserted the text.

Hope this helps,

Walt

********************************************************************************************
Walter Szewelanczyk					Technical Director 
Walter@adco.com						NET VENTURE, Inc.
http://www.adco.com					RR1 Box 1168A 
(207) 737-8205						Richmond, Maine 04357

	"One must stay in a very RIGID state of FLEXABILITY"

********************************************************************************************
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post