<Swing Dev> [10] RFR JDK-8178025:HiDPI with non-integer scale factor - SPANs in HTML are rendered overlapping each other

Alan Snyder javalists at cbfiddle.com
Thu Oct 19 14:24:18 UTC 2017


Do you mean JLabel.updateGraphicsData()?

Also, this issue could affect applications as well, if they are computing data based on layout information such as the default preferred size.

What is the recommended method for an application to respond to a change in the graphics configuration?

From looking at the code, it appears that addNotify() would be the right place, but I would never guess that just from the documentation.

  Alan



> On Oct 19, 2017, at 3:12 AM, Prasanta Sadhukhan <prasanta.sadhukhan at oracle.com> wrote:
> 
> 
> 
> On 10/19/2017 3:49 AM, Sergey Bylokhov wrote:
>> On 17/10/2017 03:48, Prasanta Sadhukhan wrote:
>>> It seems for JLabel, Component.updateGraphicsData() with proper GraphicsConfiguraiton is never called which it does for JTextComponent or JDialog. Do you know why? Because of this, correct FRC is not created.
>>> I am not sure what else I can do to create correct FRC.
>> 
>> But at some point we will get a correct GraphicsConfiguraiton for a component, right? It should be called for the window and child when we show the window on the screen, when we move the window to another screen, etc.
>> 
>> 
> Yes, it seems to be called when JLabel is added to JFrame but not before.
> Span is calculated in GlyphPainter1.getSpan() which is called when JLabel is created and
> as it seems, not when JLabel is added to JFrame (which is when we get the correct graphics configuration and therefore correct transform).
> 
> So, we need to make sure spans are recalculated when the JLabel is added to frame, which is what modified webrev does by calling JLabel.updateUI()
> http://cr.openjdk.java.net/~psadhukhan/8178025/webrev.01/
> 
> Regards
> Prasana
> 




More information about the swing-dev mailing list