public void paint(Graphics g) {
g.drawImage(backGround, 0, 0, getWidth(), getHeight(), this);
//Draw the duck, Starting coordinates are 15,15. DuckHeight/Width =60 (Defined Above)
g.drawImage(duck1, 15, 15, DuckHeight, DuckWidth, this);
//Draw the images to the screen in the order from background to foreground
bufferGraphics.drawImage(duck1, xduck, yduck, this);
g.setColor(Color.black);
g.setFont(new Font("Arial", Font.BOLD, 18));
g.drawString("Score: " + ScoreCounter, 100, 100);
}
我注释掉了将绘制图像的代码行,并且字符串成功出现。为什么我的字符串被绘制在我的图像后面?