Name: jk109818 Date: 06/12/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 :Microsoft Windows 2000
[Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
TextArea.append acts inconsistently in JDK 1.4 on
Windows2000. The first \r has no effect; subsequent ones
act as a \n. See test program for an example
REGRESSION. Last worked in version 1.3
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Run test program. First time a button is pressed, the
output is on one line.
2.Subsequent presses give results on a new line
3.
EXPECTED VERSUS ACTUAL BEHAVIOR :
I would expect the output to be the same every time an
append was made. If \r is not supported in an AWT
TextArea, it should give a box or something every time,
rather than acting as a \n sometimes and as nothing others.
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class BugTest extends Frame
implements WindowListener , ActionListener {
public static void main(String args[]) {
BugTest _BugTest__ = new BugTest();
_BugTest__.pack();
_BugTest__.show();
}
Button returnBug = new Button("returnBug");
TextArea text = new TextArea("",10,40,TextArea.SCROLLBARS_BOTH);
Panel border1 = new Panel(new BorderLayout(5,5));
int i=0;
public BugTest() {
super("main0");
this.setResizable(true);
this.addWindowListener(this);
returnBug.addActionListener(this);
border1.add("North",returnBug);
border1.add("Center",text);
add("Center",border1);
}
public void windowActivated(WindowEvent evt) {}
public void windowClosed(WindowEvent evt) {}
public void windowClosing(WindowEvent evt) {
this.dispose();
}
public void windowDeactivated(WindowEvent evt) {}
public void windowDeiconified(WindowEvent evt) {}
public void windowIconified(WindowEvent evt) {}
public void windowOpened(WindowEvent evt) {}
public void actionPerformed(ActionEvent evt) {
if ( evt.getSource() == returnBug ) {
text.append("newText"+(i++)+"\r");
text.append("newText"+(i++)+"\r");
}
}
}
---------- END SOURCE ----------
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: 143698)
======================================================================