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:
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); } }