Here you can find the source of drawRectPlot(Graphics2D g, int x, int y, int size)
public static void drawRectPlot(Graphics2D g, int x, int y, int size)
//package com.java2s; /*/*from w w w. j a v a 2s. co m*/ * Copyright (c) Leuville Objects All Rights Reserved. * * Leuville Objects MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Leuville Objects SHALL NOT BE LIABLE FOR * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ import java.awt.*; public class Main { /** * Draws a rectangle centered on (x, y) */ public static void drawRectPlot(Graphics2D g, int x, int y, int size) { g.drawRect(x - size / 2, y - size / 2, size, size); } }