I have a 2d game which the entire structure is completely coded except the graphics. I am just updating the single component of a JFrame which is a Graphic containing 50 images. Each frame the images are in a different location hence the need for a refresh rate.
To paint, I have overridden the paintComponent() method, so all I really need to do is repaint the component (which, again, is just a Graphic) every 40ms.
How do you set up a JFrame with 25FPS?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…