JDK-2159852 : JTextPane line wrap radically different from previous versions in jre 1.5.0_10+
  • Type: Backport
  • Backport of: JDK-6539700
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2008-03-06
  • Updated: 2011-02-16
  • Resolved: 2008-09-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 7
5.0-poolResolved 7Fixed
Comments
EVALUATION Here is an analysis from Sergey Grozny: I investigated the case and found the reason for the change in behavior. The customer-provided code changes space characters in the text to the non-breaking spaces. So the text that is finally put into the text pane contains no valid line break points and Java doesn't even attempt to split the text. This is why FTAHTMLEditorKit$FTAInlineView::breakView doesn't get called. This is the correct behavior. In 1.5, non-breaking spaces was considered a break point by the code that calculated minimum width for the view, and this is NOT correct. This means that changing this back will replace the correct behavior with the incorrect one, and this is not the right thing. There's a simple solution to the problem--just do not change regular spaces to non-breaking spaces in the text. The text then is split as expected, both in JDK 1.5 and 1.6. The code that replaces spaces is in the method transformSpecialChars of the class FTAHTMLWriter in the code provided by the customer. Thanks, Sergey ======================== The customer has accepted the solution and the escalation has been closed out. As a result I am closing out this bug as not a defetct
15-09-2008

EVALUATION See parent CR
06-03-2008