I want to know if there is some way to rotate a panel without changing its shape. I mean I am able to rotate the drawings inside the panel using rotate()
given in graphics2D
but the rectangular drawings become diamond shaped. Is there some soln for it?? I mean can I avoid the drawing from becoming diamond shape. The problem is more evident when u change the resolution of the screen.
Asked
Active
Viewed 2,495 times
2
-
1possible duplicate of [How to rotate an image gradually in Swing?](http://stackoverflow.com/questions/3405799/how-to-rotate-an-image-gradually-in-swing) – trashgod Jul 15 '11 at 08:54
-
1For better help sooner, post an [SSCCE](http://pscode.org/sscce.html). – Andrew Thompson Jul 15 '11 at 09:14
1 Answers
1
Yes, rotate the image around its center, as shown in this example.
-
but that doesnot seem to help me.. How does first translating and then rotating prevent the rectangular panel from getting deformed. It has to be worked on the resolution.. But I donno how.. – coder Jul 15 '11 at 09:01
-
@trashgod how can we rotate the JPanel control around an angle periodically ? – JAVA May 30 '18 at 09:15
-
@JAVA: As shown [here](https://stackoverflow.com/q/6333464/230513), you can rotate the graphics context, but rotated components are require some additional effort. – trashgod May 30 '18 at 20:38