Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.10 seconds.

  1. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    The boolean values need to be in a place that both the KeyListener and the Timer's ActionListener can access. They could share a model or refer to an outer class as described here: Action Listeners -...
  2. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    Wait, you want the rectangle to continue moving even after the user lets go of an arrow key?

    If that's the case, then you just need to set the variable once, when the user first presses the key.
    ...
  3. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    Keep track of 4 booleans: one for each arrow key.

    When the user presses one of the arrow keys, set the corresponding boolean to true.

    When the user releases an arrow key, set the corresponding...
Results 1 to 3 of 3