Here you can find the source of drawStar(Graphics g, int x, int y)
static public void drawStar(Graphics g, int x, int y)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { static public void drawStar(Graphics g, int x, int y) { g.drawLine(x, y - 3, x, y - 2);//from w w w .j a va 2 s . c om g.drawLine(x - 1, y - 1, x + 1, y - 1); g.drawLine(x - 3, y, x + 3, y); g.drawLine(x - 2, y + 1, x + 2, y + 1); g.drawLine(x - 1, y + 2, x + 1, y + 2); g.drawLine(x - 2, y + 3, x - 2, y + 3); g.drawLine(x + 2, y + 3, x + 2, y + 3); } }