I have written some coding that has a GUI that has an enter button that, when clicked, opens the tool that I have created, but what I also want the jbutton to do is to close the first GUI down as well as open the tool I have created, I have tried changing the setVisible(true/false); statements but they just hide the GUI's and it doesnt run. 
So to sum up, I want my JButton to have two functionalities, one to close the current GUI and one to open the tool I have created.
I think it has something to do with this coding to make the enterButton close the GUI:
public void actionPerformed(ActionEvent e){ 
    if(e.getSource() == enterButton){
        // coding to make the GUI exit???
    }
}
 
     
     
    