Updated the constructor of WindowElement and its implementation to have the title parameter.