jeremytaffy
Technical User
I have a pop-up JOptionPane that I am using to confirm a selection. However, I replaced the default buttons with custom JButtons. I added listeners to these buttons to do a desired activity. One of the buttons I want to use is a cancel button. I only want to close the pop-up window, not the whole program. I have this code snippet, which I know closes the whole program. How can I make it so it only closes the popup?? Thanks!
cancelbutton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0); <<<---??????
cancelbutton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0); <<<---??????