title: Shrinking JFrame causes drawings to disappear; Bullseye borders not showing up
body: <p>I'm supposed to be creating a <code>bullseye.jar</code> file. I'm having a few different issues. </p>
  
  <ol>
  <li><p>My circles within the bullseye all need borders on them, but they aren't showing up. I figured the <code>g2.draw</code> would take care of that, but no dice. </p></li>
  <li><p>When I run the program and drag the frame smaller, the bullseye sizes down as well. But I have to be sure that the smaller circles don't disappear (which they're doing when the bullseye shrinks).</p></li>
  </ol>
  
  <p>I have two classes. The first is the component class and the second is the main.</p>
  
  <p>Also here is a <a href="https://ideone.com/0yMnHr" rel="nofollow">link to an online IDE</a>.</p>
  
  <pre><code>/**
   *
   * @author joe
   */
  import java.awt.*;
  import java.awt.geom.*;
  import javax.swing.JComponent;
  
  public class BullseyeComponent extends JComponent{
  
      int count = 0;
  
      @Override
  
      public void paintComponent(Graphics g){
  
          Graphics2D g2 = (Graphics2D) g;
          //make circle fill screen
          int radius = Math.min(this.getHeight(),this.getWidth()) / 2;
  
  
          g2.draw(new Circle(this.getWidth()/ 2, this.getHeight() / 2, radius ));
          g2.setColor(Color.WHITE);
          g2.fill(new Circle(this.getWidth()/ 2, this.getHeight() / 2, radius));
  
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 25 ));
          g2.setColor(Color.WHITE);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 25));
  
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 50 ));
          g2.setColor(Color.BLACK);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 50));
  
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 75 ));
          g2.setColor(Color.BLACK);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 75));
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 100 ));
          g2.setColor(Color.CYAN);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 100));
  
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 125 ));
          g2.setColor(Color.CYAN);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 125));
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 150 ));
          g2.setColor(Color.RED);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 150));
  
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 175 ));
          g2.setColor(Color.RED);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 175));
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 200 ));
          g2.setColor(Color.YELLOW);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 200));
  
  
          g2.draw(new Circle(this.getWidth()/ 2 , this.getHeight() / 2, radius - 225 ));
          g2.setColor(Color.YELLOW);
          g2.fill(new Circle(this.getWidth()/ 2 , this.getHeight() / 2 , radius - 225));
  
      }
  }
  
  class Circle extends Ellipse2D.Double {
  
      public Circle(double x, double y, double radius) {
          super(x - radius, y - radius, 2 * radius, 2 * radius);
      }
  }
  </code></pre>
  
  
  
  <pre><code>/**
   *
   * @author joe
   */
  
  import javax.swing.*;
  
  public class BullseyeViewer {
  
      public static void main(String[] args) {
          JFrame frame = new JFrame();
          frame.setSize(500, 550);
          frame.setTitle("Bullseye");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          BullseyeComponent component = new BullseyeComponent();
          frame.add(component);
  
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
      }
  }
  </code></pre>