This simply got rid of my upgradesScreen tab.'
yes, because no component can have two parents at once. You added upgradeScreen
to JTabbedPane
first and then again added it to a JScrollPane
. The Component's add(component) function will eventually call the addImpl(component)
function: which will remove the component from it's old parent and add it to the new parent.
However:
- You need to add the
JScrollPane
to the JTabbedPane
instance.
- The component which you wish to scroll set it as a view to
JScrollPane
using the setViewportView(component)
function. for your context it is the upgradeScreen