Hello!
Iīve got a problem when I try to paint my clock which consists of a wheel and three pointers in the shapes of different flowers (pink, weird, rose). The wheel is drawn as I want. And the pPink (pink flower pointer) is also drawn as I want. The window is 400 * 400. As you see I donīt really understand how the g2d.translate() works (although, I got the first pointer right, and yes Iīve read the API but I donīt really get it). And Iīve also trouble making the pointers angle different.
Very thankful for an answer!
public void paint(Graphics g) { Graphics2D g2d = (Graphics2D) g; super.paint(g2d); ImageIcon i = new ImageIcon(this.getClass().getResource("wheel.png")); back = i.getImage(); g.drawImage(back,50,50, null); g2d.translate( 200, 200); g2d.rotate(pPink.getAngle()*(3.1415/180)); g2d.drawImage(pPink.getImg(), -44 ,-140, null); g2d.translate( 200, 200); g2d.rotate(pRose.getAngle()*(3.1415/180)); g2d.drawImage(pRose.getImg(), -44 ,-140, null); g2d.translate( 200, 200); g2d.rotate(pWeird.getAngle()*(3.1415/180)); g2d.drawImage(pWeird.getImg(), -44 ,-140, null); }