我试着旋转一个三角形 我有一个圆,然后在圆的中间有一个三角形。我想围绕三角形的中心旋转三角形。有点像360度旋转。这是到目前为止我的代码 public void paintComponent(Graphics g) { g.setColor(Color.BLACK); g.drawArc(120, 120, 100, 100, 0, 360); g.setColor(Color.RED); int[] x = {160, 170, 180}; int[] y = {150, 190, 150}; g.drawPolygon(x, y, 3); } public static void main (String[] args) { JFrame frame = new JFrame("SpinningCircle"); frame.setSize(400, 400); frame.setLocation(0, 0); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(new SpinningCircle()); frame.setVisible(true); }

我试着旋转一个三角形 我有一个圆,然后在圆的中间有一个三角形。我想围绕三角形的中心旋转三角形。有点像360度旋转。这是到目前为止我的代码 public void paintComponent(Graphics g) { g.setColor(Color.BLACK); g.drawArc(120, 120, 100, 100, 0, 360); g.setColor(Color.RED); int[] x = {160, 170, 180}; int[] y = {150, 190, 150}; g.drawPolygon(x, y, 3); } public static void main (String[] args) { JFrame frame = new JFrame("SpinningCircle"); frame.setSize(400, 400); frame.setLocation(0, 0); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(new SpinningCircle()); frame.setVisible(true); },graphics,rotation,Graphics,Rotation,` 谢谢你的帮助。你有什么问题吗?你需要帮助做什么?您尝试过哪些不起作用的方法?它是如何失败的?

`
谢谢你的帮助。

你有什么问题吗?你需要帮助做什么?您尝试过哪些不起作用的方法?它是如何失败的?