title: paintComponent () never executes on a JFrame
body: <pre><code>import javax.swing.SwingUtilities;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.BorderFactory;
  import java.awt.Color;
  import java.awt.Dimension;
  import java.awt.Graphics;
  import java.awt.*;
  import java.awt.event.MouseEvent;
  import java.awt.event.MouseListener;
  import java.awt.event.MouseAdapter;
  import java.awt.event.MouseMotionListener;
  import java.awt.event.MouseMotionAdapter;
  import java.awt.geom.*;
  import java.util.*;
  
  public class test1 extends JFrame implements MouseListener  {
      private JPanel JP = new JPanel();
  
      public test1() {
          JP.setBorder(BorderFactory.createLineBorder(Color.black)); 
          JP.addMouseListener(this);
          this.setDefaultCloseOperation(this.EXIT_ON_CLOSE); 
          this.add(JP);
          this.pack();
      }
  
      public static void main(String[] args) {
          java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                      test1 frame = new test1();
                      frame.setSize(400,400);
                      frame.setVisible(true);
                }
          });
      }
  
      public void mouseClicked(MouseEvent e) {
          //drawCircle(e.getX(), e.getY());
          //repaint();
          ballball ball;
          ball = new ballball();
          //ball.paintComponent(Graphics g);
          System.out.println("ballball");
  
      }
  
      public void mouseExited(MouseEvent e) {
  
      }
  
      public void mousePressed(MouseEvent e) {
          //this.mouseX=e.getX();
          //this.mouseY=e.getY();
      }
  
      public void mouseReleased(MouseEvent e) {
  
      }
  
      public void mouseEntered(MouseEvent e) {
  
      }    
  }
  </code></pre>
  
  <hr>
  
  <pre><code>class ballball extends test1 implements Runnable {
  
      private int squareX = 50;
      private int squareY = 50;
      private int squareW = 100;
      private int squareH = 100;
      public boolean draw;
  
      private Vector&lt;Object&gt; v = new Vector&lt;Object&gt;();
  
      public ballball() {
  
          /*addMouseListener(new MouseAdapter() {
  
              public void mousePressed(MouseEvent e) {
                  draw = true;
                  //Thread thread1 = new Thread(this.moveSquare(50, 50));
                  repaint();
                  //moveSquare(e.getX(),e.getY());
              }
          });*/
  
  
          /*addMouseMotionListener(new MouseAdapter() {
              public void mouseDragged(MouseEvent e) {
                  moveSquare(e.getX(),e.getY());
              }
          });*/
          System.out.println("ball created");
          this.repaint();
  
      }
  
      public void run() {
  
      }
  
      private void moveSquare(int x, int y) {
          int OFFSET = 1;
          if ((squareX!=x) || (squareY!=y)) {
              repaint(squareX,squareY,squareW+OFFSET,squareH+OFFSET);
              squareX=x;
              squareY=y;
              repaint(squareX,squareY,squareW+OFFSET,squareH+OFFSET);
          } 
      }
  
      public void paint(Graphics g) {
          g.drawString("abcasdfasffasfas", 10, 10);
      }
  
      //@Override
      public void paintComponent(Graphics g) {
          //if (draw) {
          // existing code
          System.out.println("paint");
          //super.paintComponent(g);       
  
          //g.drawString("This is my custom Panel!",10,20);
          //g.setColor(Color.RED);
          //g.fillRect(squareX,squareY,squareW,squareH);
          //g.setColor(Color.BLACK);
          //g.drawRect(squareX,squareY,squareW,squareH);
          Shape circle = new Ellipse2D.Float(squareX,squareY,100f,100f);
          Graphics2D ga = (Graphics2D)g;
          ga.draw(circle);
          //}
      }  
  }
  </code></pre>
  
  <p>The aim of the program is to click to create the circle, the ballball class extends the test1, when test1 detect the mouse click, the ballball object created. But the paint/paintComponent method is never be executed. In my program structure, is it possible to paint the circle to the super class JPanel?</p>