Java Close A Previous Window When I Press A Specific Button Stack

Java Close A Previous Window When I Press A Specific Button Stack