JTabbedPane indexOfComponent(component) check with == method which means it check the components are same in memory. so if you are passing the same component it will not work,
You can override the indexOfComponent method and allow it to pass the duplicate component