Here you can find the source of drawDiamond(Graphics2D g2d, int xPos, int yPos)
public static void drawDiamond(Graphics2D g2d, int xPos, int yPos)
//package com.java2s; /*/*from w ww . ja va 2 s. co m*/ * MegaMekLab - Copyright (C) 2008 * * Original author - jtighe (torren@users.sourceforge.net) * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. */ import java.awt.Graphics2D; import java.awt.Image; import java.io.File; import javax.swing.ImageIcon; public class Main { public static String recordSheetPath = "./data/images/recordsheets/"; public static void drawDiamond(Graphics2D g2d, int xPos, int yPos) { String path = new File(recordSheetPath).getAbsolutePath() + File.separatorChar; Image img = new ImageIcon(path + "shielddiamond.png").getImage(); g2d.drawImage(img, xPos, yPos, 5, 5, null); } }