How can I rotate an onscreen component in Java?
问题 import javax.swing.*; import java.awt.*; public class JFrameAnimationTest extends JFrame { public static void main(String[] args) throws Exception{ AnimationPanel animation = new AnimationPanel(); JFrameAnimationTest frame = new JFrameAnimationTest(); frame.setSize(600, 480); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(animation); frame.setVisible(true); for(int i = 0; i < 100; i++) { animation.incX(1); //animation.incY(1); animation