Results 1 to 2 of 2
  1. #1
    Taylor91 is offline Member
    Join Date
    Nov 2012
    Posts
    3
    Rep Power
    0

    Default Stop Action Listener

    I'm creating a game using a GUI. I have an action listener set up for when the user clicks the 'up', 'left', 'right', or 'down' Jbuttons. My avatar moves accordingly, but it continues to move after the button is selected. I want the avatar to move once for each click, rather than continue to move after being clicked once.

    Stop Action Listener-buttcontrols.png

    This is the code to move my avatar, for which ever button is selected.

    Thanks for any help

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Stop Action Listener

    You will probably have to show more code since the cause of your problem is not shown in the code posted. Also consider using a debugger or adding debug statements to your code to help you figure out the state of the program as it's running.

Similar Threads

  1. Can anyone help me with an action listener?
    By mdCollins1 in forum New To Java
    Replies: 5
    Last Post: 03-21-2012, 04:07 AM
  2. Replies: 2
    Last Post: 12-11-2011, 10:44 PM
  3. Stop action event in JDialog
    By eleda in forum New To Java
    Replies: 2
    Last Post: 10-15-2010, 03:24 AM
  4. Action Listener
    By greatmajestics in forum AWT / Swing
    Replies: 8
    Last Post: 03-25-2010, 05:39 PM
  5. Action Listener? how to use this?
    By jeffrey in forum New To Java
    Replies: 2
    Last Post: 10-12-2009, 08:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •