RFR: 8259687: JTabbedPane.setComponentAt doesn't hide previously visible tab component [v2]

Damon Nguyen dnguyen at openjdk.org
Thu Aug 4 06:12:53 UTC 2022


On Tue, 2 Aug 2022 06:49:33 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> I thought it might be redundant since the setVisible() checks for visibility of component within show() and hide(). But to add clarity I have add `isVisible` check.
>
> It seems this check is followed in this class
> https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/JTabbedPane.java#L390
> https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/JTabbedPane.java#L419

I agree. The isVisible check is used for similar purposes so it's for the best to follow convention here and use it.

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

PR: https://git.openjdk.org/jdk/pull/9681



More information about the client-libs-dev mailing list