<Swing Dev> [13] RFR JDK-8212904:JTextArea line wrapping incorrect when using UI scale
Philip Race
philip.race at oracle.com
Thu Mar 28 20:58:33 UTC 2019
Ok. +1
-phil.
On 3/27/19, 10:01 PM, Prasanta Sadhukhan wrote:
> Nothing specific. It was there in reproducer test in JBS and also to
> make sure the test can be run in standalone mode and not only via jtreg.
>
> Regards
> Prasanta
> On 27-Mar-19 9:33 PM, Phil Race wrote:
>> The product code change looks fine. I didn't examine the test
>> super-closely but
>> I am curious why you used System.setProperty("sun.java2d.uiScale",
>> "1.25" )
>> instead of setting it on the command line ?
>>
>> -phil.
>>
>> On 3/26/19 10:25 PM, Prasanta Sadhukhan wrote:
>>> OK. Modified webrev
>>>
>>> http://cr.openjdk.java.net/~psadhukhan/8212904/webrev.2/
>>>
>>> Regards
>>> Prasanta
>>> On 27-Mar-19 2:25 AM, Sergey Bylokhov wrote:
>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
More information about the swing-dev
mailing list