How to close previous jframe on the opening of new jframe in netbeans