英文:
How do I draw or fill a trapezoid in java?
问题
所以,你知道在Java中有某些方式可以创建形状,对吧?例如,有fillRect()和drawRect()。是否有任何方法可以用来创建梯形?就像fillTrap或drawTrap一样?我是12年级的计算机科学学生,但在Java方面经验不是很丰富。
英文:
So, you know how there are certain ways you can create shapes in Java, right? For example, there's fillRect() and drawRect(). Is there any way I can do the same thing but for a trapezoid? Like, fillTrap or drawTrap? I'm a grade 12 comp sci student, but I'm not that experienced with Java in particular.
答案1
得分: 2
没有 drawTrap
或者 fillTrap
方法,但是有:
drawPolygon(int[] x, int[] y, int numberofpoints)
所以现在你可以用纸和笔为一个多边形定义一些点,然后将它们代入我给你的方法中。
英文:
There is no drawTrap
or fillTrap
method, but there is :
drawPolygon(int[] x, int[] y, int numberofpoints)
So now using a pen and paper, you can define some points for a polygon and substitute them into the method I gave you.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论