I would like to move the origin from top left to bottom middle of the component? I have been playing with AffineTransform class could not get it to work?
+1
A:
You will need the height and width of the component that you are trying to draw. Assuming you are in the paint(Graphics g)
method the simplest way is:
paint(Graphics g){
Graphics2D g2 = (Graphics2D)g;
g2.translate( component.getWidth()/2,0, component.getHeight()/2.0);
// ... etc ...
}
Clint
2009-07-13 22:15:22
this has moved the origin but everything is still upside down.
Hamza Yerlikaya
2009-07-13 22:19:18
solved. thank you.
Hamza Yerlikaya
2009-07-13 22:26:08