private void removeAllComponents(Container container){
	if(container.getComponentCount() != 0){
		for (Component component : container.getComponents()) {
			if(component instanceof Container){
				Container childContainer = (Container) component;
				if(childContainer.getComponentCount() != 0){
					removeAllComponents(childContainer);
				}
			//System.out.println("removed: " + component.getClass());
			removeAllListenersOnComponent(component);
			((Container) component).removeAll();
			component = null;
			}
		}
	}
	//System.out.println("removed: " + container.getClass());
	container = null;
}