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

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Tue Mar 26 20:55:49 UTC 2019


Hi, Prasanta.

The "textArea.getHeight()" should be called on EDT, since this is a swing component.

On 25/03/2019 22:01, Prasanta Sadhukhan wrote:
> Thanks Sergey for the pointer. Modified test to be automated in the webrev
> 
> http://cr.openjdk.java.net/~psadhukhan/8212904/webrev.1/
> 
> Regards
> Prasanta
> On 26-Mar-19 12:02 AM, Sergey Bylokhov wrote:
>> On 25/03/2019 02:05, Prasanta Sadhukhan wrote:
>>> Thanks Sergey for the pointer. But horizontal scrollbar is not visible for both correct and broken wrap if scrollbar policy is set to HORIZONTAL_SCROLLBAR_AS_NEEDED.
>>> Also, the textArea.getHeight() is same for both textArea.setWrapStyleWord( true ) and not. Attached is the automated testcase I tried.
>>
>> In the test above the case for doWrapOffTest() still uses setLineWrap(true) which disable scroll bar, if you drop it the scrollbar will be visible.
>>
>> As of the height, you need to read the value a little bit later, not immediately after "frame.setVisible", for example if you read these values at lines 75,76 you will get something like that:
>> textArea.getHeight() = 3216
>> textArea1.getHeight() = 1616
>>
>>
> 


-- 
Best regards, Sergey.


More information about the swing-dev mailing list