> It's the Graphics2D features you want.
>
> Tom Hawtin
I'm still confused on how to do this. How do I convert a Graphics
object into a Graphics2D object so I can apply the rotation? If I
wait until the paint(Graphics g) method to be called, the Graphics
object is already instantiated and I see no way to cast it or convert
it into a Graphics2D object.
-Will
Lew - 22 May 2007 14:38 GMT
>> It's the Graphics2D features you want.
>>
[quoted text clipped - 5 lines]
> object is already instantiated and I see no way to cast it or convert
> it into a Graphics2D object.
Graphics2D g2 = (Graphics2D) g;
You'll be wanting to read
<http://java.sun.com/docs/books/tutorial/2d/index.html>

Signature
Lew
Tom Hawtin - 22 May 2007 15:21 GMT
> I'm still confused on how to do this. How do I convert a Graphics
> object into a Graphics2D object so I can apply the rotation? If I
> wait until the paint(Graphics g) method to be called, the Graphics
> object is already instantiated and I see no way to cast it or convert
> it into a Graphics2D object.
The Graphics object you get from paint will be a Graphics2D object. You
just need to cast it to get the more specific static type.
Tom Hawtin