title: How do I rotate a graphics object, without changing it's location?
body: <p>I got the following code:</p>
  
  <pre><code>import java.awt.*;
  import javax.swing.*;
  
  public class GraphicPanel extends JPanel {
  
      public void paintComponent(Graphics g){
  
          super.paintComponent(g);
          Graphics2D g2d = (Graphics2D) g;
  
          g2d.setFont(new Font("Arial",Font.BOLD,24));
          g2d.drawString("A",300,250);
          g2d.rotate(45 * Math.PI/180);
          g2d.drawString("B",300,250);
  
      }
  
  }
  </code></pre>
  
  <p>It should rotate B and put it in the same place A is, but for some reason, B apears at a totally different location.</p>
  
  <p>Pretty sure I understand why that is. It's because the entire coordination system is manipulated when scaling, rotating etc (am I correct?)</p>
  
  <p>Anyway, I'd like to know how to rotate or scale an object, and still have it appear where it was before. For example in a game that keeps updating and displaying itself every 10 milliseconds, where a sprite is being rotated, but still stays where it was 10 millisceonds before.</p>
  
  <p>EDIT: Tried to search Google beforehand, guess the wording for this question is kind of tricky because I found nothing helpful.</p>
  
  <p>Thanks a lot :)</p>