Added WindowCloseListener class