Advertisement
icorrelate

GM ObjectMovement.java

Dec 12th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import javax.swing.JFrame;
  2.  
  3. public class ObjectMovement {
  4. public static void main(String[] args) {
  5. JFrame myFrame = new JFrame("Object Movements");
  6. myFrame.setSize(519,180);
  7. myFrame.setLocationRelativeTo(null);
  8. myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  9. GamePanel gp = new GamePanel();
  10. myFrame.add(gp);
  11. myFrame.setVisible(true);
  12.  
  13. while (true) {
  14. gp.moveFBall();
  15. gp.moveSBall();
  16. gp.movetBall();
  17. gp.movefrBall();
  18. gp.moveftBall();
  19. gp.repaint();
  20. try {
  21. Thread.sleep(10);
  22. } catch (InterruptedException e) {
  23. e.printStackTrace();
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement