Im working on a battleship game for CS and im using Swing. I want to set up menus to show high scores and let the user enter their name to keep track of their record. If i create a new frame with a text field to enter the users name, how can i make the window close after entering the name and clicking OK. I guess what im saying is whats the sytax to close a window (not the whole program) . Im going to put the code under the ActionListener stuff for the JMenuBar. Thanks for any help