1//For Drawing Text
2g.drawString("Hello", 10, 10);
3// For Drawing Images
4g.drawImage(img,
5 0, 0, width, height,
6 0, 0, imageWidth, imageHeight,
7 null);
8
9// For Drawing Shapes
10g2.draw(new Line2D.Double(0, 0, 30, 40));
11