I particularly like to use Graphics.create don't know whether it is a decent way of creating separate graphics contexts but it works except with it you have to worry about clipping area.
public void rotate(int direction, double deg, Graphics2D g2d) { int width = super.image.getWidth(null); int height = super.image.getHeight(null); //create new context Graphics2D imgG2D = (Graphics2D)(g.create(currentX, currentY, width, height)); //rotate from the center using radians imgG2D.rotate(Math.toRadians(deg), width/2, height/2); imgG2D.drawImage(super.image, 0, 0, null);}
There are a couple things with this however the new Graphics object imgG2D will clip everything drawn outside of 0,0,width,height so you will get part of your images being cutoff if they are square meaning their width and height aren't the same. Also, the new imgG2D renders everything to the same screen as the original but its translated to the currentX and currentY coordinates which is why I used 0,0 in the drawImage function. Play around with it a bit its a nice way of drawing things because its completely independent of the settings from the original graphics object.
Hope this helps!