For my program, whenever a user adds a button, the button is added to "panel1" and "panel2". So far I can get it to delete whichever button the user desires in the first JPanel, panel1. But how do I delete the same button in my second JPanel according to my code I provided below? Should I check to see if the second panel contains the button with the same name? How should I do this?

```
public class deleteButton
{
   public boolean deleteNow = false;

   class ClickListener implements ActionListener
   {
       public void actionPerformed(ActionEvent e)
       {
            deleteNow = true;
       }
   }
   ActionListener deleteButtonClicked = new ClickListener();
   deleteButton.addActionListener(deleteButtonClicked);

   class ClickListenerTwo implements ActionListener
   {
       public void actionPerformed(ActionEvent f)
       {
           JButton buttonThatWasClicked = (JButton) e.getSource();
           if (deleteNow == true)
           {

               panel1.remove(buttonThatWasClicked);
               panel1.revalidate();
               panel1.repaint();
               //This is where I want it to delete from panel2.

               deleteNow = false;  
           }
           else
           { 
               System.out.println("The button wasn't deleted");
           }
       } 
   }

```

}