<div dir="auto"><div>Thanks Alexey,</div><div dir="auto"><br></div><div dir="auto">I use 125%, so looks like I got the unlucky hand here. And thanks about the multiple of 4 detail.</div><div dir="auto"><br></div><div dir="auto">I understand that this is a difficult problem to fix, but this is still something that will eventually be fixed, right? Or is this something that will just not be addressed?</div><div dir="auto"><br></div><div dir="auto">Thank you for your time and help.</div><div dir="auto">David Alayachew<br><br><div class="gmail_quote gmail_quote_container" dir="auto"><div dir="ltr" class="gmail_attr">On Fri, Aug 29, 2025, 5:24 AM Alexey Ivanov <<a href="mailto:alexey.ivanov@oracle.com">alexey.ivanov@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David,<br>
<br>
It is a known issue because of fractional scale. Unfortunately, it's not <br>
so easy to fix. The artifact that you see is the result of rounding: the <br>
button should've painted more pixels, but it didn't, therefore you see <br>
garbage left in the back buffer.<br>
<br>
What is the default / recommended scale on your system? I assume it's <br>
150%, which is the most common scale for laptops and monitors.<br>
<br>
With 125% and 175%, you usually get more artifacts than with 150%. With <br>
integral scales, 200%, the UI usually looks good without artifacts.<br>
<br>
<br>
To workaround, you can increase the height of the button. In general, if <br>
you use coordinates and widths and heights that are multiples of 4, you <br>
shouldn't see such artifacts because the standard scales will produce an <br>
integer.<br>
<br>
Your test case on Stack Overflow can be minimised to display only the <br>
button. If its coordinates and its width and height aren't multiples of <br>
4, there are high chances of seeing artifacts, however, this requires <br>
the back buffer to contain garbage that's not filled with the background <br>
colour of the frame.<br>
<br>
<br>
If you have a JBS account, you can click "Start watching this issue" to <br>
receive notifications when it's changed.<br>
<br>
-- <br>
Regards,<br>
Alexey<br>
<br>
On 2025-08-29 04:40, David Alayachew wrote:<br>
> Ty vm Prasanta. Please keep me in the loop. I will also check back in <br>
> to the JBS page on occasion to see progress on this.<br>
><br>
> On Thu, Aug 28, 2025 at 10:23 PM Prasanta Sadhukhan <br>
> <<a href="mailto:prasanta.sadhukhan@oracle.com" target="_blank" rel="noreferrer">prasanta.sadhukhan@oracle.com</a>> wrote:<br>
><br>
> Hi David,<br>
><br>
> It seems to be a bug and its there from JDK9 when HiDPI feature<br>
> was introduced in 2015..We will look into it but cannot commit on<br>
> a timeframe for now..<br>
><br>
> Regards<br>
> Prasanta<br>
> On 28-08-2025 04:11, David Alayachew wrote:<br>
>> Hello @<a href="mailto:client-libs-dev@openjdk.org" target="_blank" rel="noreferrer">client-libs-dev@openjdk.org</a><br>
>> <mailto:<a href="mailto:client-libs-dev@openjdk.org" target="_blank" rel="noreferrer">client-libs-dev@openjdk.org</a>>,<br>
>><br>
>> Here is my StackOverflow post --<br>
>> <a href="https://stackoverflow.com/questions/79748482/how-do-i-get-rid-of-these-artifacts-on-my-jbutton-and-or-what-am-i-doing-wrong" rel="noreferrer noreferrer" target="_blank">https://stackoverflow.com/questions/79748482/how-do-i-get-rid-of-these-artifacts-on-my-jbutton-and-or-what-am-i-doing-wrong</a><br>
>><br>
>> I have a simple Swing GUI that takes in an image, puts it in a<br>
>> JPanel via JLabel, then adds a button to that same JPanel. When<br>
>> doing so, I get artifacts at the bottom of my JButton. You can<br>
>> see the StackOverflow post to see the code example and the artifacts.<br>
>><br>
>> I was directed to the following bug entry --<br>
>> <a href="https://bugs.openjdk.org/browse/JDK-8253530" rel="noreferrer noreferrer" target="_blank">https://bugs.openjdk.org/browse/JDK-8253530</a><br>
>><br>
>> Long story short, the issue is with the default scaling set for<br>
>> HI DPI monitors on Windows 11 (maybe other versions too?). If I<br>
>> set the scaling down to 100%, this issue goes away, and things<br>
>> work as expected.<br>
>><br>
>> Anyways, my question is, is the linked bug something that is<br>
>> being considered? Based on the comments on it, looks like it is<br>
>> being treated as not an issue, but it wasn't flagged as such.<br>
>><br>
>> Thanks for your time and consideration.<br>
>> David Alayachew<br>
><br>
<br>
</blockquote></div></div></div>