Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JFrame;
- public class ObjectMovement {
- public static void main(String[] args) {
- JFrame myFrame = new JFrame("Object Movements");
- myFrame.setSize(519,180);
- myFrame.setLocationRelativeTo(null);
- myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- GamePanel gp = new GamePanel();
- myFrame.add(gp);
- myFrame.setVisible(true);
- while (true) {
- gp.moveFBall();
- gp.moveSBall();
- gp.movetBall();
- gp.movefrBall();
- gp.moveftBall();
- gp.repaint();
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement