The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


How can i transform a shape ?

Posted by Francisco Ca´┐Żete on June 07, 2000 at 5:23 PM

Hello, i hope u can help me.
I rotate rectangle by executing these sentences:
r2 = new Rectangle2D.Float(50,50,50,100);
AffineTransform rot45 = AffineTransform.getRotateInstance(90,0.0,0.0);

But what i really want is to get the new coordinates of the rotated
rectangle, because if i ask for X,Y points the response will be
(50,50), although the rectangle has been rotated 90 degrees.
If I try to create a new rectangle by calling createTransformedShape, i
get an executing error?!! This is the code:

Rectangle b = new

I 've tried the same with line2d and the same has happened. Can tell me
how can i get the new coordinates of a shape after rotating it ?

Thanks for all


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us