Question: Does Wicket notifies a Panel when this Panel is removed/replaced in the Page?

I add JavaScript (initialization code) in Panel's constructor and need to release some resources when Panel is removed.

Answer: 
Later versions of Wicket (1.4.0+) have Component#onRemove() method, which is needed to notify the component that it's being removed from the component hierarchy.
There is also PubSub system at the client side where you can do what you need.
See <https://cwiki.apache.org/confluence/display/WICKET/Wicket+Ajax#WicketAjax-GlobalAjaxcalllisteners> and event '/dom/node/removing'.