因此,我有一个问题,它很简单,我害怕问。我是新手,请不要烤我。如何在Java中递归地绘制简单线条?
我想要画一条垂直线:100像素长和90°角。 在顶端,我想要2条线,50个像素向左右45°。 SO最后看起来像是“Y”。
我画出了垂直线,但我不知道如何做其余的?你可以帮我吗?
for (int q = 0; q < count; q++){
g.drawLine((int)tempLine.x1, (int)tempLine.y1, (int)tempLine.x2, (int)tempLine.y2);
tempLine = new Line2D.Double(tempLine.x1+260, tempLine.y1+490, tempLine.x2+260, tempLine.y2+390);
你需要递归什么? – Berger
递归是为了划线 –
[为什么“有人可以帮我吗?”不是真正的问题?](http://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question) – azurefrog