On Sat, 30 Jul 2022 00:27:28 GMT, Harshitha Onkar <[email protected]> wrote:
>> src/java.desktop/share/classes/javax/swing/JTabbedPane.java line 1603:
>>
>>> 1601: if (this.visComp != null &&
>>> 1602: !this.visComp.equals(component)) {
>>> 1603: // previous component visibility is set to false
>>
>> It seems `isVisible` is checked before changing the visibility..Should we do
>> it here too?
>
> 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
-------------
PR: https://git.openjdk.org/jdk/pull/9681