Panel close problem

Hi

I have a panel inside a panel. there is also a close button inside the panel. on click of close button it should close the inside panel and clear all memory associated with it. How can it be implemented?

Thanks

I think you can use something like this :


((ComponentContainer)insidePanel.getParent()).removeComponent(insidePanel);
insidePanel = null;

Then as long as you you don’t keep yourself any reference to insidePanel it should get garbage collected soon.