What is dispose () used for?
Dispose () used for hide and dispose of the frame when the user close it. This removes the frame from the screen and frees up any resources used by it.