title: Concerns about the function of JPanel: paintcomponent()
body: <p>hello I'm new in java programming, and i need someone explaining me these lines of code:</p>
  
  <pre><code> public class drawpanel extends JPanel
   {
       public void paintComponent(Graphics g)
       { 
           super.paintComponent(g);
           ...
       }
   }
  </code></pre>
  
  <p>I dont understand the line <code>public void paintComponent(Graphics g)</code>: why do i have to declare that function like that if it's predefined in JPanel? </p>
  
  <p>And this line <code>super.paintComponent(g)</code>: I dont understand it at all. Thank you for your help.</p>