Here you can find the source of addTo(Insets i1, Insets i2)
public static void addTo(Insets i1, Insets i2)
//package com.java2s; /*// w ww. j a v a 2s . co m * @(#)InsetsUtil.java * * Copyright (c) 2004-2010 Werner Randelshofer, Immensee, Switzerland. * All rights reserved. * * You may not use, copy or modify this file, except in compliance with the * license agreement you entered into with Werner Randelshofer. * For details see accompanying license terms. */ import java.awt.*; public class Main { public static void addTo(int top, int left, int bottom, int right, Insets i2) { i2.top += top; i2.left += left; i2.bottom += bottom; i2.right += right; } public static void addTo(Insets i1, Insets i2) { i2.top += i1.top; i2.left += i1.left; i2.bottom += i1.bottom; i2.right += i1.right; } public static void addTo(Insets i1, Rectangle i2) { i2.x -= i1.top; i2.y -= i1.left; i2.height += i1.top + i1.bottom; i2.width += i1.left + i1.right; } public static void addTo(Insets i1, Dimension i2) { i2.height += i1.top + i1.bottom; i2.width += i1.left + i1.right; } }