Agree with Mohammed earlier. You want a JDialog, which disappears after use. Much better than trying to create two frames and dispose of the second.
Actually, you can probably use the
setDefaultCloseOperation method on the frame, with
DISPOSE_ON_CLOSE, so the dispose() call may be unnecessary.