Here you can find the source of expand(Rectangle rectangle, int expansion)
public static void expand(Rectangle rectangle, int expansion)
//package com.java2s; //License from project: Open Source License import java.awt.Rectangle; public class Main { public static void expand(Rectangle rectangle, int expansion) { rectangle.x -= expansion;//w w w .ja va2 s. co m rectangle.y -= expansion; rectangle.width += expansion * 2; rectangle.height += expansion * 2; } }