Results 1 to 2 of 2

Thread: Keybinding help

  1. #1
    Peperono is offline Member
    Join Date
    Sep 2012
    Rep Power

    Default Keybinding help

    Hey all, brand new to the fourms, and fairly new to programming. I have had a year class on Java, but that's all. Hence, when I go the Java Tutorials, or such similar websites, I find myself WAY over my head. Is there any way to show me how to make a simple keybind for the "D" key? Action Listeners and the like are above my head at the moment.

    If it's any help, I'm trying to make a basic game, and using NetBeans.

    private void btnTestKeyPressed(java.awt.event.KeyEvent evt) {

    Netbeans generated that for me, and I tried to put in the //KeyStroke.getKeyStroke("D");

    My feeble attempt... Just the kind of thing that I am looking for.
    Last edited by Peperono; 09-17-2012 at 11:08 PM.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: Keybinding help

    The first place I would start if I were you would be to check out the Key Bindings Tutorial. It's got great explanation as well as sample code that you can try out and modify. Please let us know if any specific concepts in the tutorials are unclear to you after you've given them an in-depth study. Best of luck.

Similar Threads

  1. Problem with keybinding
    By dendenmushi in forum New To Java
    Replies: 10
    Last Post: 05-17-2012, 06:49 PM
  2. KeyBinding not responsive
    By Germoose in forum New To Java
    Replies: 3
    Last Post: 04-21-2012, 11:10 PM
  3. Keybinding
    By mine0926 in forum New To Java
    Replies: 4
    Last Post: 01-11-2011, 05:33 AM
  4. KeyBinding Help
    By Lil_Aziz1 in forum New To Java
    Replies: 12
    Last Post: 07-27-2010, 03:58 PM
  5. ZombieEscape: Multiple KeyBinding at one moment?
    By Unome in forum Java Applets
    Replies: 0
    Last Post: 11-17-2008, 06:51 PM

Posting Permissions

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