Write a program that draws two solid squares: one in pink and one in purple. Use a standard color for one of them and a custom color for the other. Provide a class TwoSquareViewer and a class TwoSquareComponent.

Here is a sample program output:

.

Complete the following file:

TwoSquareComponent.java

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

Use the following file:

TwoSquareViewer.java

import javax.swing.*;

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

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

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

      frame.setVisible(true);
   }
}