protected void paintComponent(Graphics g) {
Graphics2D gr = (Graphics2D) g.create();
// draw Original image
super.paintComponent(gr);
// draw 45 degree rotated instance
int aci=-45;
gr.transform(AffineTransform.getRotateInstance(Math.toRadians(aci)));
super.paintComponent(gr);
//translate rotated instance from origin to +10 on y axes
gr.translate(0,10);
super.paintComponent(gr);
}
But what if I want to draw the rotated shape at its original image origin.
I mean I want to rotate shape its origin without sliding