One more thing: Since you need this logic for more than 1 component, ideally you'd implement it outside the actual component. The component shouldn't need to close itself after a defined amount of time and nor should this logic be repeated ( sure, you could make both windows inherit from the same base that implements this closing logic, but from an architectural and performance point of view, it's better if such logic is not implemented into the component itself ).