rotating text problem
- From: "Bruintje Beer" <me@xxxxxxxxxx>
- Date: Sat, 13 Oct 2007 08:15:39 +0200
Hi,
I have problem with a piece of code (see below). When the text is rotated on
my panel it seems that the coordinate system is corrupt. If I put something
on x,y = 100, 200 it looks that the object is put somewhere else. I think it
has to do with the rotation. How can i go back to the norm coordinate
system/
PS : The rotation works fine for the first time
Johan
void paintComponent() {
Graphics2D g2 = (Graphics2D)g;
AffineTransform af = new AffineTransform();
af.translate(100.,50.);
af.rotate(Math.PI / 2);
FontRenderContext renderContext = new
FontRenderContext(null, false, false);
g2.transform(af);
TextLayout layout = new TextLayout("This text is rotated",
g2.getFont(), renderContext );
layout.draw(g2, 0, 0);
}
.
- Follow-Ups:
- Re: rotating text problem
- From: Roedy Green
- Re: rotating text problem
- From: a24900@xxxxxxxxxxxxxx
- Re: rotating text problem
- Prev by Date: Re: Table cell with a combobox that has a calendar inbeded to the combobox
- Next by Date: Re: rotating text problem
- Previous by thread: jDiffChaser v0.8 released (GUI diff tool)
- Next by thread: Re: rotating text problem
- Index(es):
Relevant Pages
|
|