Java examples for 2D Graphics:Rectangle
get Rectangle Top Center
//package com.java2s; import java.awt.Point; import java.awt.Rectangle; public class Main { public static Point getTopCenter(Rectangle bounds) { Point pt = bounds.getLocation(); pt.translate(bounds.width / 2, 0); return pt; }// w w w .jav a2s .c o m }