Lanai bugs relating to text not being centered in the control

Kevin Rushforth kevin.rushforth at oracle.com
Tue May 12 12:20:28 UTC 2020


There have been a couple bugs filed showing buttons or other controls 
with the text being offset from the rest of the control. The earliest of 
these is the one I filed back in January:

JDK-8236952 <https://bugs.openjdk.java.net/browse/JDK-8236952>: Text 
initially rendered too high in JButton with metal pipeline

The following three were filed more recently, two of them today:

JDK-8242945 <https://bugs.openjdk.java.net/browse/JDK-8242945>: Initial 
Selections of Buttons is not correct
JDK-8244805 <https://bugs.openjdk.java.net/browse/JDK-8244805>: Lanai - 
Button text is not center aligned
JDK-8244809 <https://bugs.openjdk.java.net/browse/JDK-8244809>: Print 
Dialog and Page Dialog: text is shifted up a bit

I took a closer look at the images from all these bugs, and I'm fairly 
certain that it isn't the text that is drawn too high, but rather that 
the rectangle / image in which the text appears is drawn too low. This 
is most noticeable in the images for JDK-8242945 
<https://bugs.openjdk.java.net/browse/JDK-8242945>, where you can see 
that the text is aligned for all three controls, but the highlighted one 
has its rectangle drawn lower than the others. I can also see this with 
JDK-8236952 <https://bugs.openjdk.java.net/browse/JDK-8236952> by 
switching between the Metal and OpenGL images. Note that the text is at 
the same position in both, but the rectangle of the button is lower in 
the Metal image.

-- Kevin



More information about the lanai-dev mailing list