RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v4]

Alexey Ivanov aivanov at openjdk.org
Thu Jan 30 11:50:51 UTC 2025


On Wed, 29 Jan 2025 02:52:16 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> test/jdk/javax/swing/JMenuItem/duke.gif line 1:
>> 
>>> 1: GIF89ap!�:,�3f���++3+f+�+�+�UU3UfU�U�U���3�f��������3�f��������3�fՙ������3�f������3333f3�3�3�3+3+33+f3+�3+�3+�3U3U33Uf3U�3U�3U�3�3�33�f3��3��3��3�3�33�f3��3��3��3�3�33�f3Õ™3��3��3�3�33�f3��3��3��ff3fff�f�f�f+f+3f+ff+�f+�f+�fUfU3fUffU�fU�fU�f�f�3f�ff��f��f��f�f�3f�ff��f��f��f�f�3f�ffÕ™f��f��f�f�3f�ff��f��f����3�f���̙��+�+3�+f�+��+Ì™+��U�U3�Uf�U��UÌ™U�����3��f�����̙������3��f�����̙������3��f�ՙ��̙������3��f�����̙����3�f�������+�+3�+fï
 ¿½+��+��+��U�U3�Uf�U��U��U�̀̀3Ì€f̀�̀�̀�̪̪3̪f̪�̪�̪�����3��f�ՙ����������3��f�����������3�f�������+�+3�+f�+��+��+��U�U3�Uf�U��U��U�����3��f�������������3��f�������������3��f�ՙ����������3��f�����������	Hp1e
>> �f�B�ʈ�#F���&ŀM��bb`�@b	%�OL�052��,
>> J��z����F��l���L�C��1R�o��}�	T�� ����R}�	�ԬU	f��L+װ72��֯?F��O�2�T1�}��Ī;
>> 
>> Can't you generate an image on the fly? It doesn't have to be Duke, any image like a red square or rectangle will do.
>
> I chose not to as firstly, for the test to be same as actual usecase where proper gif image is used so as to trace the same image decoding codepath (instead of using a BufferedImage) and secondly, since it is about image icon, it will be easier for tester to discern if there is actual image rather than a red sqaure/rectangle which tester can think of primitives
> and finally, there will not be a licensing issue for duke so I guess this is ok for this test.

Once the image is in `ImageIcon`, it doesn't matter where it came from: generated, loaded from disk.

If red square could be confused, you can use a red circle, you can add an ‘i’ into the icon, there are quite a few options which could still make it clear the menu item contains _an image_… like a circle in a square.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1935476640


More information about the client-libs-dev mailing list