java box calculator