Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.09 seconds.

  1. Replies
    5
    Views
    2,948

    Re: keyPressed method not working?

    When do you add the KeyListener? Recommended reading: How to Write a Key Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)
  2. Replies
    5
    Views
    2,948

    Re: keyPressed method not working?

    Ah, I see. Your keyPressed() method seems to be inside your main() method, which is not allowed. You could have an anonymous inner class, but I don't think that's what you're going for, since you...
  3. Replies
    5
    Views
    2,948

    Re: keyPressed method not working?

    You're going to have to supply an SSCCE that demonstrates the error- it could be that the source of your problem is in another piece of code (probably a missing bracket or parenthesis). Boil it down...
Results 1 to 3 of 3