Context
Wanting to learn how to use custom JDialogs for non-trivial, validated data input, I searched and found an interesting answer to a closely related question.
What I don't understand is why the code in the provided answer works.
My Question
Since the JDialog object has executed setVisible(false) and dispose() in the actionPerformed() method of its anonymous ActionListener, by the time the caller gets back program flow and tries to get the fields, shouldn't the Garbage Collector have destroyed this fields already?