Swing Display Problem with JTabbedPane
I have an application that used JTabbedPane. Each tab of the tabbed pane is a JPanel, added simply with JTabbedPane.addTab().
The JPanels that serve as tabs range from simple to complex, where the complex JPanels sometimes consist of other JPanels as children, or even JPanels containing JScrollPane()'s containing JPanels containing components etc.
The problem I have is that when the JTabbedPane is initially displayed and the first tab is shown, as I mouse over the tab components from other tabs are displayed. For instance, if I have 2 tabs, tab1 and tab2, and tab1 is initially displayed, then as I mouse over tab1, the components of tab2 can be displayed through tab1. Sometimes the components of non-selected tabs are displayed on the first tab on initial startup even when I don't mouse over. In all instances I'm unable to interact with these components, they just seem to be displayed incorrectly.
The problem is always resolved if I sequentially click on each tab. After doing this, all components are properly laid out and I no longer have the mouse over problem on any tab. The problem re-appears if I programmatically alter the components of tabs not currently being displayed, in which case I need to sequentially click on each tab as described above to resolve the problem.
I've added validate() commands to various parts of the code, but this has not solved the problem.
I realize that this may be a JPanel (or some other) problem that only surfaces when I use a JTabbedPane. I've been through the JTabbed Pane documentation and tutorials and haven't yet found anything to help, which is why I'm here.
Any and all help will be greatly appreciated.
Thanks

