<Swing Dev> [13] RFR JDK-8212904:JTextArea line wrapping incorrect when using UI scale

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Tue Mar 19 07:03:12 UTC 2019


Hi All,

Please review a fix for an issue where it is seen that
line wrapping of JTextArea doen't work correctly if you set 
wrapStyleWord = true and you use a UI scale (either by setting 
"sun.java2d.uiScale" or by setting display scale of Windows)

It is a regression of JDK-8132119: Provide public API for text related 
methods in SwingUtilities2
where many public text related API was added catering to floating point 
hidpi scale.
This issue happened because of that as the public 
Utilities.getBreakLocation() API, used to determine where to break the 
given text, is using non-floating point methods.

Proposed fix is to make sure correct getBreakLocation() method is called 
and not the deprecated(integer based) one
and also the floating point based getBreakLocation() API uses floating 
point API based calculations.

Bug: https://bugs.openjdk.java.net/browse/JDK-8212904
webrev: http://cr.openjdk.java.net/~psadhukhan/8212904/webrev.0/

Regards
Prasanta


More information about the swing-dev mailing list