RFR: 8332550: [macos] Voice Over: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location [v2]

Abhishek Kumar abhiscxk at openjdk.org
Thu Jun 6 05:14:45 UTC 2024


On Wed, 5 Jun 2024 22:27:43 GMT, Alisen Chung <achung at openjdk.org> wrote:

>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   copyright year update
>
> src/java.desktop/share/classes/javax/swing/table/JTableHeader.java line 1368:
> 
>> 1366:                     try {
>> 1367:                         parentLocation = parent.getLocationOnScreen();
>> 1368:                     } catch (IllegalComponentStateException icse) {
> 
> should we be preventing the exception by checking if the JTableHeader is visible or not instead?

As per the spec, getLocationOnScreen() API can throw ICSE and it should be right to catch this exception rather than preventing it upfront by checking JTableHeader's visibility. Moreover, I tried checking with the visibility, still got the ICSE while performing the testing. So, I think this should be an ideal way to handle.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19391#discussion_r1628783298


More information about the client-libs-dev mailing list