RFR: 8235404: [macos] JOptionPane blocks drawing string on another component [v2]
Harshitha Onkar
honkar at openjdk.org
Mon Aug 5 19:23:32 UTC 2024
On Mon, 5 Aug 2024 17:56:41 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
>> added null check
>
> @alisenchung
>
> Shouldn't both cases be handled here?
> when parentComponent is null - JOptionPane.showMessageDialog(null, t), it does not work in this case.
> when parentComponent is NOT null - JOptionPane.showMessageDialog(f, t)
I looked into the JOptionPane code so when parentComponent is null, for some cases [getRootFrame()](https://github.com/openjdk/jdk/blob/e2c07d5044587476fc0fff14260e2b73816d2062/src/java.desktop/share/classes/javax/swing/JOptionPane.java#L1692) is used, this returns a hidden frame (in case nothing is set as RootFrame) and thus the test case is not applicable here.
Hence "when parentComponent is null" is not valid case here.
The fix looks good.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20359#discussion_r1704537952
More information about the client-libs-dev
mailing list