I do have idea how it works. So I am confused. because I want to generate a main window which would be having few buttons to give users choice of actions to be performed. once user will choose the action, I want to put a dialog box for user asking further choices. so it should be like, once i get one answer, i should close that window and further a new window would be generated asking user for further choices, and so on.