Inspite of this frame.setVisible(false);

Try this one
frame.dispose(this);