title: Overriding paintComponent
body: <p>Ok so I have been trying to figure this out for the past 26 hours with guide and online help but no success.</p>
  
  <p>All I want to do is draw an oval when the user clicks in the PaintPanel
  Please someone help so I can sleep :P</p>
  
  <p><img src="https://snag.gy/gFBiF.jpg" alt="screen"></p>
  
  <p>In PaintApplet class:</p>
  
  <pre><code>  private void PaintPanelMouseClicked(java.awt.event.MouseEvent evt) {                                        
      // TODO add your handling code here:
      if(FillRadioButton.isSelected())
      {
      PaintPanel.setBackground(JColor.getColor());
     PaintPanel.repaint();
      }
      if(BrushRadioButton.isSelected())
      {
           Point ComponentPoint = PaintPanel.getLocationOnScreen();
           PaintPanel.add(new Painter(ComponentPoint));
      }
  }           
  </code></pre>
  
  <p>Painter Class:</p>
  
  <pre><code>import java.awt.Color;
  import java.awt.Dimension;
  import java.awt.Graphics;
  import java.awt.Graphics2D;
  import javax.swing.JFrame;
  import javax.swing.JPanel;
   import java.awt.*;
  
  public class Painter extends JPanel{
  
  Point  Component;
  
  public Painter(Point Com)
  {
      Component = Com;
  }
  
  public void paintComponent(Graphics g) 
  {
  
          super.paint(g);
        Point CursorPoint=   MouseInfo.getPointerInfo().getLocation(); //gets cursorpoint
  
         int ComPX =  Component.x;
          int ComPY =  Component.y;
          int CurPX =  CursorPoint.x;
          int CurPY =  CursorPoint.y;
          int FinalX = CurPX - ComPX;
          int FinalY =  CurPY - ComPY;
  
         g.drawOval(FinalX, FinalY, 20, 20);
  
  
  
  
  }
  }
  </code></pre>