TabbedComponent and resized()

I have a couple of component in a TabbedComponent, i wanted to set the size of the entire window that holds my app to the size of the currently selected component (in the the tabbed component). I overloaded the currentTabChanged() method and everything works fine except. When resizing the entire window ALL components in the tabbedComponent get reszied() and so have the same size, and there is no way to remember the sizes for each of the components as they are always the same no matter what. Is there a way to make each component different size (actually to change the whole window size) when tabbedComponent changes the current visible component?

Can’t think of any quick ways - maybe you should instead give each component a way of specifying its preferred size so that when the tab changes, you just set the whole size to that?

In the resized method of each held component, check with the tab and see if they’re the current component, or else don’t resize?

So probably make an interface class with that behaviour - maybe it could still call the sub-class resized if needed (or vice versa).


i’m thinking of something like a “Lock” button that will lock each of the panels in a certain size and return the whole app to that size when the component is active again. i don’t know how this will work in practice i have a lot of code to write and very little time to do it.