Here you can find the source of distance(int one, int two)
public static String distance(int one, int two)
//package com.java2s; //License from project: LGPL public class Main { public static String distance(int one, int two) { if (one > two) { return (one - two) + "px below"; } else {//from www .ja v a2s . c o m return (two - one) + "px above"; } } }