I am overriding a Jpanel's paintcomponent in order to draw and rotate a few images however it has the unwanted side effect of rotating other things such as JLabels added to the JPanel etc. I have tried rotating back after drawing the image but the JLabels seem to jitter.
Please note that I am rotating each image around different points within the image (not the center of the image) so rotating the image within the image buffer is not suitable?
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.rotate(Math.toRadians(+(angle)), 137, 188);
g2.drawImage(image1, 125, 131, this);
g2.rotate(Math.toRadians(-(angle)), 137, 188);
g2.rotate(Math.toRadians(+(angle2)), 137, 188);
g2.drawImage(image2, 125, 131, this);
g2.rotate(Math.toRadians(-(angle2)), 137, 188);
}