title: Deleting images from JFrame
body: <p>I created one <code>JFrame</code>. and set layout shown in below code</p>
  
  <pre><code>    this.setLayout(new GridLayout());
      JPanel panel=new JPanel();
      panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
      panel.add(new PicturePanel1());
      JTabbedPane jtp=new JTabbedPane();
      jtp.addTab("show Images", panel);
      jtp.addTab("Compare Image", new JButton());
      this.add(jtp);
  </code></pre>
  
  <p>I created another class that draws Images from particular location.</p>
  
  <pre><code>protected void paintComponent(Graphics g) {
     super.paintComponents(g);
     Graphics2D g2 = (Graphics2D) g;
     int k = 20,y=10;
     for (int j = 0; j &lt;= listOfFiles.length - 1; j++) {
         g2.drawImage(b[j], k, y, 100, 100, null);
        // add(new javax.swing.JCheckBox());
         k = k + 120;
         if(k&gt;=960)
         {
             k=20;
             y=y+120;
         }
         }
  </code></pre>
  
  <p>Its working fine. I want to delete Images when user clicks on particular Image.</p>
  
  <p>This is my output window. I want to delete Image from list.<img src="https://i.stack.imgur.com/Z5obP.png" alt="enter image description here"></p>