direi che fa quello che chiedi
usa il metodo
setDefaultCloseOperation(WindowConstants.DO_NOTHIN G_ON_CLOSE)