Well, what you are using is not standard Java library class so I can't provide help with that code.
Anyway, use paper to do calculations you need. Draw one rectangle and another one (smaller) inside it, placed at the center of the first one. It will be easy to deduce the position of the smaller one in terms of the big one. Use that conclusion to place rectangle in your code at proper position.