draw Cross Hair - Java java.awt

Java examples for java.awt:Graphics2D

Description

draw Cross Hair

Demo Code


//package com.java2s;

import java.awt.Color;
import java.awt.Graphics;

public class Main {
    public static void drawCrossHair(Color c, Graphics g, int x, int y,
            int size) {
        g.setColor(c);//  w ww .j  av  a 2s  .co m
        int l = size / 2;
        g.drawLine(x - l, y - l, x + l, y + l);
        g.drawLine(x - l, y + l, x + l, y - l);
    }
}

Related Tutorials