Here you can find the source of grow(Rectangle2D r, float amountx, float amounty)
public static void grow(Rectangle2D r, float amountx, float amounty)
//package com.java2s; /**//from w w w .ja v a 2 s . com * Copyright (c) 2010-2014, Jean-Daniel Fekete, Pierre Dragicevic, and INRIA. * All rights reserved. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ import java.awt.geom.Rectangle2D; public class Main { public static void grow(Rectangle2D r, float amountx, float amounty) { r.setRect(r.getX() - amountx, r.getY() - amounty, r.getWidth() + amountx * 2, r.getHeight() + amounty * 2); } }