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
-
My 4th gen classic wont unlock. reset doesnt work any help
my 4th gen ipod classic will not unlock. Reset and restore does not work. Any suggestions?
I assume you mean the lock switch seems to be stuck in the On position whether or not it's toggle Off or not?
If a restore of the iPod to factory settings doesn't resolve the issue, it's likely a good indication of a faulty/damaged lock switch meaning you'll need to either take or send your iPod in for service. You can choose to have Apple do an out of warranty exchange (unless your iPod is still under the 1 year warranty against manufacturing defects and they deem the issue a defect in which case they will swap it out for you at no cost) or send it to a third party service who can replace the faulty part for a little less.
B-rock -
MY IPHONE WAS WORKING NORMALLY SUDDENDLY IT TURNED OF AND DOESNT WORK ANY MORE!WHEN I PLUGED IT TO THE CHARGER GIVES THAT ITS IN THE RECOVERY MODE WHEN I REMOVE THE CHARGER IT TURNED OFF DIRECTLY SO WHAT I SHOULD DO PLZ HELP !
Please turn off your caps lock.
All caps indicates shouting, is considered rude and is difficult to read. Many simply will not read such posts.
Enter & Exit iPhone Recovery Mode -
the time i run icloud on my phone,camera doesnt work any more,when i push on camera to take photo after a second it goes to home page .i turn off photo stream,rest my phone,even restore again still camera doesnt work,what shall i do?
Dude or hot-spur,
Not fishy at all!!!! You really think I would have taken any more of my time to post a bogus rant? We'll no, it is unfortunately all true. I want to hear from anyone who is experiencing such problems not anyone else that wants to put there two cents in. I really don't need anymore hate or negativity. Just people's experiences because I feel like I am the only one having so many problems. Thank you
Yes, I have had some unfortunate bad luck to have so many problems at the same time, but some of them are just things you cannot do on the new OS.
Thank you again -
hello! My iMac frozed and I had to switch the electricty supply off and on in order to start again the system, with the problem that the screen looks wierd, I tried to calibrate it... doesnt works any suggestion?
Dear Paul, thank you very much for your time and answer, I followed those steps, somehow it helped the performance of my Imac, is faster now, but the screen issue about the very High contrast colours is still there. Since I am a photographer I am very depending on the screen calibration. I am worried that I came to damage the video card when I shut down the computer from the swicth when It was frozed.
-
youtube loads but then when i click on a video it doesent play. it worked fine the other day and in the past and suddently it doesnt work. please help!!!!!!
Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
"Remove Cookies" from sites causing problems:
*Tools > Options > Privacy > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.com/kb/Safe+Mode -
Since I upgrade to Lion OS my optical drive stop working can't read or write at all I did what I could to fix it but still not working , any help please
It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
http://www.adwaremedic.com/kb/baddns.php
http://www.adwaremedic.com/kb/hackedrouter.php
If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
(Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.) -
Apple Composite AV Cable no longer working on Ipad2 after ios8 update. I'm only getting sound no video can you revert back to ios7 or buy a cable that will work any help would be appreciated
ThanksThe 30-pin connector on the iPhone 4 dock might not have all the connector pins to do video.
I'm 99% sure the Universal Dock does have the pins (and therefor supports video out). -
my friend just got a new iPhone and whenever he plugs his headphones in the mic no longer works. any help on what to do?
Hello dariusLoL
Start your troubleshooting with the article below to troubleshoot issues with your friends iPhone.
iPhone: Hardware troubleshooting
http://support.apple.com/kb/ts2802
Regards,
-Norm G. -
i have just upgraded my iphone 4 to a 5. and was trying to back my 4 up on the computure so i could get all my pics and music on to my 5. but its saying i need to update my itunes which i have tried to do and is still not working any help please i have been trying for hours
how is it not working?
what version of itunes?
what ios on iphone4?
does it give an error msg? -
iTunes will not install on my computer (Windows 8) and i tried everything in "Issues installing iTunes or QuickTime for Windows" but nothing worked. any help?
Many thanks.
Error 7 (Windows error 127)
Try the following user tip:
Troubleshooting issues with iTunes for Windows updates -
I have purchased new iphone 3gs, its usb cable and charger not working.When I plugged in usb cable to my laptop it says"usb power hub exceeded". When I use another cable I have, it works fine.But the original one not working.Any help?
Are you connecting your iPhone directly to your PC or to a USB hub?
-
ı buy virtual tenis game but doesnt work 3gs help please
ı buy virtual tenis game but doesnt work 3gs help please
ALL U.S. iphones are carrier locked and CANNOT be unlocked at all. They can ONLY be activated with AT&T in the U.S. No other carrier, no other country.
No. A U.S. iphone would have to be returned to the U.S.
If possible you need to return the iphone to the U.S. for a full refund and buy one in your country. -
just downloaded ios6 on my ipod touch and lost all color when I select an artist or song how can I get it to be blue again tried resetting did not work any help offered would be liked
You need to restore.
Everything should be on your computer, so you can just sync it back.
iPod touch User Guide (For iOS 4.3 Software) -
I have the "Hanvon 5040 drawing tablet",it was working perfectly with mac till last month.As soon as i plug the USB of my tablet into my macbook pro the computer is blocked and an error apears: "you need to restart your computer..."nothing works.Any help?
Check with the manufacturer for updated drivers for your tablet.
-
When i charge my ipod it workd but as soon as i take it out the charger it doesnt work any suggestion on how to make it work?
It may need a new battery, take it to an Apple Store and check.
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?)