On Tue, 4 Jul 2023 14:17:51 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

> It means you have to look into how it's done in JList so that JCheckBox works 
> in a similar way.

For a JList, whenever `setText` is invoked from renderer's 
`getListCellRendererComponent` method, JLabel's text is set to the value 
displayed in JList. So, a11y API invokes the `getAccessibleName` method for 
`AccessibleJLabel` and that returns the correct string.

But in case of JComboBox, a11y API invokes the `getAccessibleName` method for 
`AccessibleJButton` and that returns an empty string.

To fix this we need to get the current displayed text is JComboBox as the other 
way around is not correct for custom renderer.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1252133130

Reply via email to