get Rectangle Right Center - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

get Rectangle Right Center

Demo Code


//package com.java2s;
import java.awt.Point;
import java.awt.Rectangle;

public class Main {
    public static Point getRightCenter(Rectangle bounds) {
        Point pt = bounds.getLocation();
        pt.translate(bounds.width, bounds.height / 2);
        return pt;
    }/*from www  .ja va 2 s . c o  m*/
}

Related Tutorials