Repeat Exercise P8.17 by designing classes LetterH, LetterE, LetterL, and LetterO, each with a constructor that takes a Point2D.Double parameter (the top-left corner) and a method draw(Graphics2D g2). Which solution is more object-oriented?

Here is a sample program output:

.

Complete the following files:

LetterE.java

LetterH.java

LetterL.java

LetterO.java

LettersComponent.java

Use the following file:

HelloViewer.java

import javax.swing.*;

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

      final int FRAME_WIDTH = 200;
      final int FRAME_HEIGHT = 150;

      frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
      frame.setTitle("HelloViewer");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

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

      frame.setVisible(true);
   }
}