What is a "JButton window"? It sounds like you're showing a dialog window of some type, say a JDialog or JOptionPane, and you can make it close by calling setVisible(false) or dispose() on the dialog.