Name: jk109818 Date: 04/11/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
FULL OPERATING SYSTEM VERSION :
Windows 98 [Version 4.10.2222]
A DESCRIPTION OF THE PROBLEM :
When the method java.awt.TextArea.append(...) is used to
append "\r\n" to a TextArea that is currently showing on
the screen, only the first letter of each word that comes
after the "\r\n" will be displayed on the screen, until the
next repaint of the TextArea. All letters after the first
letter seem to take the background color and will not show
before the TextArea is manually resized or a redraw is
forced in some other way.
The bug appears with JDK 1.4.0 under Windows 98.
The TextArea class works fine with JDK 1.3.1_01 under
Windows 98 and also with JDK 1.1.7B and JDK 1.3.0 under
Linux x86.
REGRESSION. Last worked in version 1.3.1
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the supplied class "TextAreaBug"
EXPECTED VERSUS ACTUAL BEHAVIOR :
The expected display in the TextArea is, of course:
This line will be fine.
This line will be messed up.
However, with JDK 1.4.0-b92 under Windows98 4.10.2222 you
will see:
This line will be fine.
T l w b m u
The missing characters will appear when areas of the window
are hidden by other windows and then exposed again, or if a
redraw is forced by resizing or iconifying/deiconifying the
window.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
/**
* Demonstrates a bug in the java.awt.TextArea class.
* @author Mirko Raner, PTSC
* @version 1.0 (2002-03-08)
**/
public class TextAreaBug
{
public static void main(String[] arg)
{
Frame frame = new Frame();
TextArea text = new TextArea();
frame.add(text);
frame.pack();
frame.setVisible(true);
String string;
string = "This line will be fine.\r\n";
string += "This line will be messed up.";
for (int index = 0; index < string.length(); index++)
{
text.append(string.substring(index, index+1));
}
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
A redraw can be forced programatically with setVisible
(false); setVisible(true), but that is not an acceptable
workaround in many cases, because it produces and annoying
flicker and also makes the caret disappear.
Release Regression From : 1.3.1_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 143946)
======================================================================