System.out.println("How \n are \n you");
产生:
How
Are
You
与预期一样。但...
g.drawString("How \n are \n you", xPos, yPos);
产生:
How are you
没有适当的缩进。我明白我可以单独画三次,每次都降低y坐标,如下:
g.drawString("How", xPos, yPos);
g.drawString("are", xPos, lowerYPos);
g.drawString("you", xPos, evenLowerYPos);
但这似乎很草率。有没有办法使用g.drawString();
进行缩进?