RFR: 8259687: JTabbedPane.setComponentAt doesn't hide the previous visible tab component

Harshitha Onkar honkar at openjdk.org
Thu Jul 28 22:05:09 UTC 2022


A simple change listener is used in JTabbedPane to lazily fill with components - this is done by adding the components to JTabbedPane using the `setComponentAt` in the change listener.

Previously, if the change listener was placed before calling `addTab()` , the previous visible component was overlapping with the current visible component. To fix it, the visibility of previous component is set to false before the current component's visibility is set to true in `setComponentAt`.

Following are the before and after fix screenshots-

![image](https://user-images.githubusercontent.com/95945681/181642658-bc6ccf25-8b62-485e-8128-801331418ce6.png)

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

Commit messages:
 - added summary and removed commented lines
 - JTabbedPane setComponentAt changes

Changes: https://git.openjdk.org/jdk/pull/9681/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9681&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8259687
  Stats: 112 lines in 2 files changed: 112 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/9681.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9681/head:pull/9681

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



More information about the client-libs-dev mailing list