Here you can find the source of alignsVertically(Rectangle r1, Rectangle r2)
static public boolean alignsVertically(Rectangle r1, Rectangle r2)
//package com.java2s; /******************************************************************************* * SiniaUtils/*w ww . ja va 2s .c om*/ * Copyright (c) 2011-2 Siniatech Ltd * http://www.siniatech.com/products/siniautils * * All rights reserved. This project and the accompanying materials are made * available under the terms of the MIT License which can be found in the root * of the project, and at http://www.opensource.org/licenses/mit-license.php * ******************************************************************************/ import java.awt.Rectangle; public class Main { static public boolean alignsVertically(Rectangle r1, Rectangle r2) { return r1.getMaxX() == r2.getMaxX() && r1.getMinX() == r2.getMinX(); } }