KeyListenerr...doesnt work...any help?

hi im new and running this simple code trying to learn use KeyListener...so any help is appreciated
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class keyboard11 extends Applet implements KeyListener {
     String S;
     char c;
     public void init()      {
          System.out.println("inside\n");               //test
          addKeyListener(this);
          requestFocus();
          System.out.println("outside\n");              //test
     }          //-----------END OF INIT() ----------------------------
public void KeyPressed(KeyEvent e)     {
          System.out.println("its working!!\n");                 //test
          S = e.getKeyText(e.getKeyCode());
          showStatus("Pressed  S="+S);
          System.out.println("wooooooooorks\n");             //test
          repaint();
     }          //----------END OF KEYPRESSED() -----------------------     
}               //-----------END OF THE CLASS() ------------------------also i try to use KeyTyped() and Keyreleased() but its the same with KeyPressed() so have to handle with this first...thnx for the help :)

The correct name for your method is ->keyPressed. Java is case sensitive. ("k" needs to be written downcase)
Edited by: AikmanAgain on Mar 8, 2008 1:35 PM

Similar Messages

Maybe you are looking for

  • Creative Zen 32GB - Is it Dead?

    Hi. I bought a Creative Zen 32gb Flash player in January 2009. It was mostly OK for the first year or so. By then, it was almost full. Last summer, it began crashing on me every so often. I assumed it was just because it was almost full, but as time

  • Accept/Deny incoming network connection for apps already accepted/denied

    i am constantly getting the dialog box to allow/deny incoming network connections for applications that i launch on my MBPro, even though these programs have already been allowed or denied. this causes multiple entries for the same applications in my

  • The application Welcome quit unexpectedly

    Hello, I have recently purchased a MacBook Pro 17' and I have problem installing some softwares. When I launch the installation, "The application Welcome quit unexpectedly." I have done all updates and I'm currently running the 10.5.1 version. Thanks

  • Java Error Handling-Something Weird

    While working with Exception Handling I've found (written in java manuals) that we can't handle Errors in catch blocks. Is it correct? Or experts want to write that we shouldn't handle but we can handle them. For example: try some recursion; catch(St

  • Want to move location of photos

    I imported them without moving them.  So they're in the catalog. How do I transfer them to the drive which contains the entire catalog.  (I should have hit "move" right?)