RFR: 8282526: Default icon is not painted properly [v3]

Alexey Ivanov aivanov at openjdk.java.net
Tue May 17 20:03:44 UTC 2022


On Tue, 26 Apr 2022 22:06:09 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> Detect the situation where we do need to perform interpolation during ImageIcon
>> painting and set a hint to the rendering to perform bicubic approximation so
>> image details are preserved during transition.
>
> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Take into account scale factor;
>   Create a new Graphics2D object instead of juggle the rendering hints;

It could be that the new API that we use on Windows ignores the passed in size and returns the icon of the default size. If possible, we should explore options to make this work correctly.

Is a test case available for that? Do I simply start JFileChooser on standard screen which uses 100% scale and look for files without a defined type?

On the other hand, @azuev-java demonstrates the problem exists in general: if an icon is scaled down, it may lose relevant details and become white square — it doesn't look good, does it?

It's possible to give user/programmer control by adding a property: if it's defined, ImageIcon paints as before without switching to bicubic interpolation.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7805



More information about the client-libs-dev mailing list