Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    There isn't any code to make the JFrame disappear. Look at the JFrame class (and the classes it extends) to see if there are any methods that will do what you want.
  2. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    Yes that is one of the problems.


    What should it do?
  3. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    Did you look at the times for the first slower run and for later faster runs.
    Were the the print outs made more frequently later?

    How many timers are running on the second run and on later runs?...
  4. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    Does it ever stop?
    After a replay, how many timers are running?

    Add a call to System.currentTimeMillis() to the println so you can see how often the method is called:

    System.out.println("aP...
  5. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    Put a println() in the actionPerformed() method that is called by the time to see when it is called.
  6. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    What is printed out by the println()s I suggested you add? Do they print more often as the snake speeds up?
  7. Replies
    13
    Views
    1,723

    Re: Method keeps looping and timer issues.

    Can you post a complete program that compiles, executes and shows the problem?


    Is there more than one method being executed that move the snake? Add println() statements next to the code that...
Results 1 to 7 of 7