Name: gm110360 Date: 02/10/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b32c)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b32c, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux 2.4.22-1.2149.nptl
A DESCRIPTION OF THE PROBLEM :
If a TextArea is created in JDK 1.5 for linux without a horizontal scrollbar, the text it is initialized with will not have any line breaks inserted if the text length exceeds the width of the TextArea. All other JDKs, including JDK 1.5 for windows, will insert line breaks in the appropriate locations to ensure all of the text is visible.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Make a TextArea with an initial string longer than the width of the area and without a horizontal scrollbar:
TextArea ta = new TextArea("This text should be wrapped", 3, 10, TextArea.SCROLLBARS_VERTICAL_ONLY);
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Line breaks should appear between text / should and be / wrapped
ACTUAL -
No line breaks are present and the end of the line is not visible
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.*;
public class TextAreaBug extends Frame
{
public static void main(String [] args) { new TextAreaBug().show(); }
TextAreaBug()
{
super("TextArea Bug");
this.setBounds(50, 50, 400, 400);
this.setLayout(new FlowLayout());
this.add(new TextArea("This text should be wrapped", 5, 10,
TextArea.SCROLLBARS_VERTICAL_ONLY));
this.pack();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Insert line breaks manually and hope the appropriate break locations are chosen.
Release Regression From : 1.4.2_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 238062)
======================================================================