I am programming a GUI application in Java. I do it for the first time.
I would like to have a form (with radio buttons and so on). After the form is filled in and the "Submit" button is pressed I would like to have a new window. I see two potential ways to do it:
Close the "old" window and open a "new" one.
Remove "old" elements from the existing window and put there "new" elements.
What is the standard way to go? If it is the first way, what is the command to close the window? If it is the second one, how can I remove elements from the existing window?