On Mon, 19 Jun 2023 08:49:10 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:
>> src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java line >> 162: >> >>> 160: AccessibleContext ac = this.getAccessibleContext(); >>> 161: if (ac != null && (comboBox.getSelectedItem() != null)) { >>> 162: >>> ac.setAccessibleName(comboBox.getSelectedItem().toString()); >> >> Are you sure that the toString() method always provides a valid string, and >> not a descriptive JSON or some other character set that is useless for a >> blind user? > > I tested several times, didn't get such kind of result and as per java docs > toString method returns `a string representation of the object.` So, I think > it will be a valid string. An interesting question… it depends on the object. At the same time, if I'm not mistaken, the renderer also uses `.toString()` to display an object. However, it's possible to set a custom renderer which may display an arbitrary property from an object. Did you try to populate combo box with anything but `String` objects? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/14497#discussion_r1246636688