Here you can find the source of drawArrowLine(Graphics g, int x1, int y1, int x2, int y2, int dist, boolean arrowLeft, boolean arrowRight)
public static void drawArrowLine(Graphics g, int x1, int y1, int x2, int y2, int dist, boolean arrowLeft, boolean arrowRight)
//package com.java2s; /*/*from w w w .j a v a 2s .c o m*/ * File: GraphicsHelper.java * Copyright (c) 2004-2007 Peter Kliem (Peter.Kliem@jaret.de) * A commercial license is available, see http://www.jaret.de. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html */ import java.awt.Graphics; public class Main { public static void drawArrowLine(Graphics g, int x1, int y1, int x2, int y2, int dist, boolean arrowLeft, boolean arrowRight) { int off = 3; g.drawLine(x1 + off + 1, y1, x2 - off - 1, y2); if (arrowLeft) { g.drawLine(x1, y1, x1 + dist, y1 - off); g.drawLine(x1, y1, x1 + dist, y1 + off); g.drawLine(x1 + dist, y1 - off, x1 + dist, y1 + off); } if (arrowRight) { g.drawLine(x2, y2, x2 - dist, y2 - off); g.drawLine(x2, y2, x2 - dist, y2 + off); g.drawLine(x2 - dist, y2 - off, x2 - dist, y2 + off); } } }