Write a program that fills the window with a large ellipse, with a black outline and filled with your favorite color. The ellipse should touch the window boundaries, even if the window is resized.

Here is a sample program output:

.

Complete the following file:

EllipseComponent.java

import javax.swing.JComponent; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Ellipse2D; public class EllipseComponent extends JComponent { public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; . . . } }

Use the following file:

EllipseViewer.java

import javax.swing.*;

public class EllipseViewer
{
   public static void main(String[] args)
   {
      JFrame frame = new JFrame();

      frame.setSize(300, 400);
      frame.setTitle("EllipseViewer");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      EllipseComponent component = new EllipseComponent();
      frame.add(component);

      frame.setVisible(true);
   }
}