Here you can find the source of drawHorizontalArrow(Graphics g, Rectangle r, boolean direction)
public static void drawHorizontalArrow(Graphics g, Rectangle r, boolean direction)
//package com.java2s; /*/* w ww . j a va 2 s. c o m*/ * Copyright (c) 2007-2012 The Broad Institute, Inc. * SOFTWARE COPYRIGHT NOTICE * This software and its documentation are the copyright of the Broad Institute, Inc. All rights are reserved. * * This software is supplied without any warranty or guaranteed support whatsoever. The Broad Institute is not responsible for its use, misuse, or functionality. * * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. */ import java.awt.*; public class Main { public static void drawHorizontalArrow(Graphics g, Rectangle r, boolean direction) { int[] x; int[] y; int dy = r.height / 3; int y0 = r.y; int y1 = y0 + dy; int y3 = y0 + r.height; int y2 = y3 - dy; int yc = (y1 + y2) / 2; int dx = yc - y0; if (direction) { int x1 = r.x; int x3 = x1 + r.width; int x2 = x3 - dx; x = new int[] { x1, x2, x2, x3, x2, x2, x1 }; y = new int[] { y1, y1, y0, yc, y3, y2, y2 }; } else { int x1 = r.x; int x3 = x1 + r.width; int x2 = x1 + dx; x = new int[] { x1, x2, x2, x3, x3, x2, x2 }; y = new int[] { yc, y0, y1, y1, y2, y2, y3 }; } g.fillPolygon(x, y, x.length); } }