Detecting when a component is 'really' visible


I’m switching a component between windows by calling addAndMakeVisible() and setBounds(), I need to trigger a function
when the component is actually visible in its place on the window, how can I achieve that?



could you not just setBounds first, call addAndMakeVisible, and implement the visibilityChanged?


visibilityChanged() will be called in addAndMakeVisible so it won’t work.


Try the ComponentMovementWatcher class?