Hi All!
Wrote code to write a string "HELLO", everything works good but I feel that there has to be shortest way to do the same. Need to know, just curiosity :)
Thanks.

LetterH class(LetterE, LetterL and LetterO are written in same way):
Java Code:
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.Graphics2D;

public class LetterH {
	public void draw(Graphics2D g2)
	{
		Point2D.Double p1 = new Point2D.Double(0,0);
		Point2D.Double p2 = new Point2D.Double(0,20);
		Point2D.Double p3 = new Point2D.Double(0,10);
		Point2D.Double p4 = new Point2D.Double(10,0);
		Point2D.Double p5 = new Point2D.Double(10,20);
		Point2D.Double p6 = new Point2D.Double(10,10);
		
		Line2D.Double part1 = new Line2D.Double(p1, p2);
		Line2D.Double part2 = new Line2D.Double(p4, p5);
		Line2D.Double part3 = new Line2D.Double(p3, p6);
		
		g2.draw(part1);
		g2.draw(part2);
		g2.draw(part3);
		
	}

}
LetterHelloComponent class:

Java Code:
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.awt.Graphics2D;

public class LetterO {
	public void draw(Graphics2D g2)
	{
		Point2D.Double p1 = new Point2D.Double(60,0);
		Point2D.Double p2 = new Point2D.Double(60,20);
		Point2D.Double p3 = new Point2D.Double(70,0);
		Point2D.Double p4 = new Point2D.Double(70,20);
		
		
		
		Line2D.Double part1 = new Line2D.Double(p1, p2);
		Line2D.Double part2 = new Line2D.Double(p1, p3);
		Line2D.Double part3 = new Line2D.Double(p3, p4);
		Line2D.Double part4 = new Line2D.Double(p2, p4);
		
		g2.draw(part1);
		g2.draw(part2);
		g2.draw(part3);
		g2.draw(part4);
	}

}
LetterViewer class:

Java Code:
import javax.swing.JFrame;
import javax.swing.JComponent;
import java.awt.Graphics;
import java.awt.Graphics2D;

public class LetterViewer {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		JFrame frame = new JFrame();
		frame.setSize(300, 400);
		frame.setTitle("Hello String");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		LetterHelloComponent component = new LetterHelloComponent();
		frame.add(component);
		frame.setVisible(true);

	}

}