title: Java Rotate ImageIcon About Center by Given Angle
body: <p>This seems like an easy task, but I've literally searched for hours and haven't found anything so far. I have an ImageIcon which I would like to rotate by a certain angle.</p>
  
  <p>What would be the simplest way to do this?</p>
  
  <p>Edit: I tried converting the ImageIcon to a BufferedImage, and rotating the Graphics2`bPlayerImage = new BufferedImage(
                  playerSize, playerSize, BufferedImage.TYPE_INT_RGB);</p>
  
  <pre><code>    Graphics2D g = (Graphics2D)bPlayerImage.getGraphics();
      g.rotate(Math.toRadians(turnAngle));
      g.drawImage(playerImage, x, y, null);`
  </code></pre>
  
  <p>The image doesn't appear to rotate.</p>