Why is Component not drawing anything?
<p>sorry, this is probably a really basic question, but i have a class thats called butterfly with the code for drawing a butterfly object like so:</p>

<pre><code>import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BasicStroke;

public class butterfly extends JPanel {
public butterfly() {
}
     public void draw(Graphics2D g2){
    //the width of the oval. A petal is an oval.

    //TODO: Your code goes IN HERE (not in main), ALL OF IT. Replace the code below.

    //draw one oval of length 300pixels from center to edge
    g2.setColor(Color.blue);
    g2.fillOval(500,55, 70, 70);
    g2.fillOval(450, 40, 70, 70);
    g2.fillOval(460,100, 40, 40);
    g2.fillOval(495, 110, 40, 40);


    g2.setColor(Color.black);
    g2.setStroke(new BasicStroke(13));

    g2.drawLine(520, 50, 490, 150);

 }

}
</code></pre>

<p>also then i tried putting it in this component so i can put more objects with it but it won't even draw the butterfly?</p>

<pre><code>import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class RippingOffofAmy extends JComponent
{

    private butterfly yay;

    public RippingOffofAmy()
    {
        yay = new butterfly();
    }

    public void paintComponent(Graphics g)
    {
        Graphics2D g2 = (Graphics2D) g;

       //checks to see if rectangle has moves 100 places yet
       //if has, then adds new obstacle and resets count
       yay.draw(g2);

        //draws obstacle and avatar
    }

}
</code></pre>

<p>why? (ignore the class names and comments I used some of my friends code)If I'm missing something can someone be really specific about what to add bc I'm terrible at java, thanks!</p>