Confusion about keyboard listeners.. Need HELP!

I have a applet. I need to query the user for a piece if information (a single digit is needed). I can't figure out how read in user input through a JTextArea. I looked up the registerKeyboardAction method but according to Sun that is obsolete and to use getInputMap and getActionMap methods instead.
I can't figure out how to use the 'Map' methods to get user input; I can't even find example code.

It kind of sounds like you want to do some processing while the user goes about entering more data on the screen.
The KeyListener is one way. Another is by using a FocusListener (the textfield has focus, then it doesn't)
It's hard to answer your question because you don't give enough info.
Perhaps you have a screen up and the user is to enter a digit, hit enter, then enter another digit and so on. In that case the KeyListener is a good option.
Perhaps you want to validate the input while the user is entering info in other areas of the screen. Here either a KeyListener or FocusListener will do it.
Perhaps the user will eventually dismiss the screen using an OK button. In that case you could just use an ActionListener.
There are lots of examples in the tutorials at www.java.sun.com, especially in the Swing Tutorial.
There is also a long, long list of example code you can find at the Developer's Connection.
Hope this helps

Similar Messages

  • HT5622 Hey Hi ! I brought iPhone 5 in Kuwait and now I'm in India now.I noticed my FaceTime option is missing. No option no settings and no data related to FaceTime . I'm very much worried about it. Need help as soon as possible.

    Hey Hi ! I brought iPhone 5 in Kuwait and now I'm in India now.I noticed my FaceTime option is missing. No option no settings and no data related to FaceTime . I'm very much worried about it. Need help as soon as possible.

    Someone could have stolen it in Kuwait...happens all the time .
    Seriously...FaceTime is banned there...there is no way to add it back to your phone...if you wanted FaceTime, you should not have purchased your phone there.
    BTW: You don't have any warranty or support for this phone in India.
    You live & you learn

  • Macbook running 10.6.8 not recognizing my midi usb keyboard! Need Help!

    Hi im using a macbook running 10.6.8. I have literally spent about 12 hrs trying to fix this problem, I have with my mac recognizing my midi usb akai mpk mini keyboard. I have not heard about this problem on any other websites but basically my mac dosnt recognize it 7out of 8 times, and when it does I have roughly 5 to 15 minutes before all of a sudden my computer completely forgot it. I have tryed restarting it, finding drivers on akai's website, and messing with my 32 bit and 64 bit kernal settings. It came with this janky *** software that is very poorly explained in the manuel. But I have to admit the first 3 days I had it everytime I plugged it in my computer knew what it was, but as soon as I unplugged it for my trip to florida and plugged it in 8 hrs later, it started pooping out on me. I really need help I dont know if it is my midi settings, my hardware, the keyboard, or the janky software it came with. But if anyone can help me please help me out.

    Really hope you figured this out as it's been 4 months. For the rest of you with similar problems I purchased the same device today and experienced the exact same problems. In the end I tried a new USB cable and everything was fine.

  • When i try to send  a message in mail it says it cannot use the server. I know very little about macs and need help

    i need help with the email on my mac. it says i cannot use the sever. any help would be awesome thank you

    If you are trying to connect to your ISP e-mail account. The ISP will help you setup and connect to your e-mail account. So, you might want to give them a call.
    Usually, when you are told that you can't use the server it means that there might be an error (either a wrong name/ address / password/ connection type/ etc.) so check your settings again...
    Else you could try the following:
    http://support.apple.com/kb/HT1277
    http://www.switchingtomac.com/tutorials/how-to-check-your-hotmail-using-mailapp/

  • Question about hard drive, need help lol.

    Hey I'm kinda new to the MacBook world and have a stupid question. I am getting a late 2009 MacBook unibody (white polycarbonate, model MacBook 6.1... I believe) I am switching the original 250gb 5400 rpm hard drive out for a Seagate Momentus XT 750gb 7400 rpm hybrid hard drive. I want to keep everything on the original hard drive and just pop the new hard drive and start fresh with Snow Leopard. I'm going to purchase the SL cd from apple but I do not have the original  grey start up cd that came with it (my girlfriends little sister lost it). Do I need to call apple for that cd in order to start fresh on my new hard drive or is everything I need on the SL cd?
    Also how do I go about wiping the whole computer when I put the hard drive in and use SL? I want to essentially have a completely clean laptop with a new hard drive.
    Thanks for your help in advance.

    The SL disc you get from Apple will do everything you need. When you nstall the new hard drive there will be nothing to wipe, the drive is the only piece of that Mac hat stores anything so you don't need to worry about that. Post back and let me know how that hybrid drive works out....I'm interested.

  • Adventures in 24p, things we can all laugh about (but I need help!)

    Hello everyone!
    I'm walking into a disaster area, I have a friend who's shot over 100 hours of footage here for a documentary recently. She's handled all the production herself and it looks fantastic, she did a great job. The problems here is her current logger has absolutely no clue what he's doing.
    The knowledge I have of the project here is limited but bear with me. First off, it looks like he's about 2/3 of the way done logging and he's been at this for nine months. Yes folks, nine months to log 66 hours of video. He's got NO bins ANYWHERE so basically there are a few thousand clips on the root of the browser window (yay!). That's not really the issue I'm coming to you guys with though. Reorganization will be a pain in the butt but I can manage if it becomes my responsibility.
    My issue is that she has come to me to make a DVD for her trailer. Upon opening the project I notice that not a single deck in my post house is taking the firewire signal. Upon further inspection I noticed she captured and her timeline is in 3:2 pulldown. She said she did it on some Panasonic camera in order to be able to do 24p. Firewire output wasn't the biggest concern, I was just doing it to be thorough in monitoring, though I took note that it could mean issues later.
    So my first question:
    Coming from a SD DV NTSC source, shouldn't the capture preset and timeline option just be all glorious default 29.97 NTSC regardless of the shot framerate?
    Final Cut seems to be playing it alright in it's viewer but... again no firewire output.
    So! Trying to ignore the issues I saw coming up and moving along trying to get this trailer out for her (and upon fixing every title which was nowhere near even action safe, HELLO!), I exported the sequence as an mpeg in DSP3. As I had predicted there were massive framerate issues, stutter central.
    There are many issues here which I'm trying to compel her to get a new guy for her post management and I may even have to step in myself to help besides this possible framerate issue. But, any issues on capture seem to be the biggest concern right now, especially if this all needs to be relogged.
    And thus my second question:
    Based on the limited information I've given you guys, does it sound like I'm going to have to re-log everything?
    Believe it or not this is gonna be a big documentary picked up by a major cable television network so things need to be fixed and in a hurry so the actual editing process can begin. Any advice will be helpful! Thanks!
    -Jim

    Yes. But. Was it shot 24P or 24PA (I hope 24P).
    When you check the clips, what frame rate do they
    have in their properties? When you say her sequence
    has 3:2 pulldown, do you mean the sequence is 29.97?
    The FW output is likely unrelated to any frame rate
    issues. FCP will insert pulldown on the fly to
    display a 24fps sequence (I believe). Can FCP see the
    FW decks?
    Well when this job completed production, our house dubbed a backup of every DV via firewire on our old DV decks running DV SP mode. As far as I know, those decks won't play back 24PA (speaking of the Sony DSR-30, DSR-11 and an old Panasonic DV2000). So I assume it's just plain 'ol 24P.
    The sequence settings said the framerate was 24 and if I try and toss the clips in a 29.97 sequence it's looking to render out. Unfortunately I don't have access to the materials now for further investigation.
    For the record this is FCP 4.5 I'm working on. As for why FCP isn't sending out the firewire properly, I assumed it was cause of the sequence settings, it works normally with no problems. FCP will toss out the first frame and will play the audio but no video.. looks exactly like the problem if your canvas viewer is set to high.

  • Confused about keyboard choices for MIDI/GB??

    I'm a guitar player (well, in a very loose sense i can be called a player) and want to learn to play some keyboard while playing around with garage band. i want to do the hammond B3 sound, more than a piano sound. i'm hoping to get some advice here about a MIDI keyboard. i'm considering either a casio WK series, an Maudio 61 or 88, or maybe even something like a novation or roland A37.
    as i understand it, a "standalone" like the casio would allow me to easily take the keyboard over to a friend's house for a jam session, while the MIDI controller style would need to have a computer, speakers, etc. transported along with it. correct? this may be a big advantage for the casio.
    I see a lot of comments about the feel of the keys on different keyboards, and a number of criticisms of the casio feel in particular. but, how much difference is this really going to make to a rookie? there are some $150 guitars out there that are pretty nice, and while an $800 guitar is certainly nicer, i sound equally bad on both. is the feel/quality of the keys going to be a limiting factor? are the "pros" going to be the ones who really benefit from investing in higher quality boards like the roland?
    I appreciate any information and advice.

    Yes, 37 keys is not enough if you want to learn to play organ properly. If the Ozonic had 61 keys as well as everything it already has, it would in my opinion be the perfect controller and audio interface for the bedroom studio.
    I'm a singer with some guitar ability who can find the chords on a keyboard one-handed; I never developed much facility with two-handed playing despite a couple of years of class piano in music college.
    I got the Ozonic because I need something affordable and compact and I liked the idea of having the audio interface and the controller keyboard in one unit with FireWire.
    D. T., I think you are right. Look into 5-octave, 61-key controllers. You can play the vast majority of everything you'll need on a keyboard that size.
    By the way, up until the time of Mozart, Beethoven, and possibly Chopin, pianos had only five octaves. So you can play most classical music on such a keyboard as well.
    And today, most organs, whether Hammond or real cathedral pipe organs, use 5-octave manuals.

  • Question about photo shop, need help

        I downloaded a version of photoshop a friend recommended because I was looking for a free photoshop to use... So I downloaded it, and when I opened it, here is the response I got:
        "This program may not have installed correctly. If this program didn't install correctly, try reinstalling using settings that are compatible with this version of windows."
        I am using a windows 7 computer. Here is a link to the photoshop the dude sent me:
        I really want to figure out how to get this to work, I am terrible with computers and I don't even know if it is gonna show the link to the photoshop I had downloaded here on this post, but, I wanna figure out how to get this to work so I can go about creating my own mugen video game (I wanna learn mugen).. But first I need to figure out how to get photoshop to work, I am not very good with computers. Does anyone have any idea why I "may not have installed it correctly?
          I will attempt to type in the url to my photoshop download manually here,
              <link removed>
           If the first link doesn't show the photoshop I downloaded, hopefully the 2nd one where I typed it in manually will work... Does anyone have any idea why it's doing this or what I can do to get it to work?

    Bravo to you for seeing the light that if you want to play you have to pay.
    The best place to buy Photoshop is directly from Adobe.
    Brace yourself:  The full version of Photoshop is amongst the most expensive software out there.
    You might want to look into buying Photoshop Elements.  It does most of what the full version of Photoshop does and it won't break the bank.
    And stay off eBay for buying Photoshop.  The "too-good-to-be-true prices" you sometimes see are scams, and you'll likely get ripped-off.
    For what it's worth, I don't know of too many programs that charge as subscriptions.  Of course, if you consider that every few years new versions are released that require paying for the upgrade, that's not too different.  But if you don't upgrade you can keep using the version you have for no additional cost.
    -Noel

  • Question about Dynamic Overclocking - Need help/advice

    Hello,
    I recently upgraded to version 3.9 bios on my MB (K8N SLI paltinum).
    I had DOT enabled before the upgrade, on 9% extra. this worked ok. as soon as a program required heavy CPU, DOT kicked in and give me a 9% boost. and it also cooled off, back to normal operations when the CPU was idle again.
    now, since the upgrade to 3.9, the DOT always stays at 9%? when booting up, when idling, always...? Is there a setting that I missed? or is it a bug in 3.9?
    --> after the upgraded I loaded the optimized defaults.
    thanx for any help.
    S.

    hi guys,
    thnx all for the updates. I'm currently using DOT on 9%. It runs rock stable. IIf I set it on 11%, no problems.
    C&Q is off, always was.
    The problem with DOT is, that it doesn't do what it should do. (in 3.9 bios). nl, when the CPU runs on 0% load, no Over-clocking is need.
    Any other settings that I should check?
    Do I need to turn on Q&C?
    thnx!

  • Startup Error - Worried About Recovering Data - Need Help!

    Hi All...
    This is my first time posting to the forum, and I'm hoping someone can help me.
    Last night, I used my MacBook Pro (specifics are pasted below) with no issues at the airport. I then boarded my flight, stowed my laptop under my seat, and landed. Total duration was about 2 hours. I got to my car, and wanted to make some notes and, when I turned on my computer, I got these screens. One is a pink and white pixelated screen, and the other is some sort of candy-striped screen with the same pink and white colors.
    I've NEVER seen anything like this before, and it's got me worried. I'm most concerned with recovering all of my files at the moment.
    The computer seems to be working normally in terms of no strange sounds, or clicks, or anything like that indicating that anything has been dislodged internally, or anything like that.
    I have all the startup and installation discs if they'll help restore anything.
    Can anyone help me? Please?
    Thank you for any advice you can offer.
    -matt

    Quick update: went to the Apple store last night and, magically, the computer turned on like nothing was wrong. I'm guessing the ghost of Steve Jobs was in that store last night.
    I'm not convinced - based on my gut, and the Apple experts - that the problem is solved. I can get the computer to boot up to diagnostics and all that, but I think it might be time for a new one. I've actually attached some screengrabs of the error report if you'd be so kind to take a look.
    That said, my funding is kind of limited at this point. And, while I'd love to throw down $1,500 for a newer model, I just can't. I'm in the $500-700 range, honestly. So, I'm wondering what you'd recommend. I purchased my current model on eBay several years ago and, as I said, it worked beautifully up until now.
    Does the year of the machine necessarily dictate how well it will function? Like, because of the two year difference - rather than the OS, or installed features - is a 2008 MAC definitely going to function less well than a 2010 MAC? I've never been sure of how that works.
    So, if you'd be interested in entertaining one last request, I guess it would be your recommendation as to what type of system I should search for. Is there a wave of MACs from the past that, in your expert opinion, seemed to perform particularly well?
    Again, I'm very grateful for all of your help. Thank you!
    Screengrabs:

  • New and confused.. I need help please

    Good morning
    I just got my iphone 4S, and I'm struggling with the App Store billing.  I've downloaded whatsapp, and it asked me for billing info, so I've put my husband's credit card details on there.  Now, I need to update Facebook and it gave me a message that there was a problem with the previous billing info, but I don't have a credit card and would like to use my cellphone account (Cellc) to pay (IF I ever decide to actually buy something from there), but there is no such an option, only Visa, Amex and another credit card (most people I know uses their cellphone account).  Even when I log in to icloud or even here, it shows my husbands name and not mine.  How on earth do I change this?

    Well, never living in South Africa, I don't know how you pay for things, but in Europe, Japan, USA, Canada, and Australia, (and living in most of those places), credit cards are the normal way of doing things.
    At least here in the USA, you can use PayPal on iTunes. PayPal is in South Africa, so if it you can set that up, you can use it. If you set up a new credit card or PayPal then you can use another name.
    However, it's not all that relevant. I do not believe the name shows up anywhere, except when you buy things. Your apple ID is the only thing that matters, and you can make that whatever you want. If you put Facebook on your iPhone, you're going to be entering your Facebook ID, not anyone elses.
    Really, don't worry about any of this.

  • NO clue about JAVA but need help please

    I am cleaning up someone's else work who used to be employed here. I know ZIP about Java but am becoming more and more familiar with WAR files and deplying them with Jrun on an NT2K Server.So here is what I have. I have a deployed app from months ago. I have a new app to deploy. I did this successfully. I can access it, etc. But I am getting some SQL error.
    Can anyone give me any idea what it could be? I have looked at my sqlcustomauthentication.java file and i have not anything to it. Why would something change on this when all I really did was re-deploy it.
    Here is the error.
    Thanks a TON!!
    java.lang.NullPointerException:
         at allaire.jrun.security.SQLCustomAuthentication.getName(SQLCustomAuthentication.java:76)
         at jrun__members2ejspc._jspService(jrun__members2ejspc.java:62)
         at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:39)
         at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:228)
         at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:196)
         at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
         at allaire.jrun.session.JRunSessionService.service(JRunSessionService.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
         at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
         at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
         at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java, Compiled Code)
         at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java, Compiled Code)
         at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
         at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)

    It looks like maybe you are having a problem in the way you are accessing the authentication on your db. From the error message, I would say the name field needed to log in is never being set

  • What to do now about update? Need help!

    I had this problem on my iMac, where the Airport automatically disconnected from the internet (Beacon lost thing). Now I installed my Leopard again and I have the software Version 10.5
    My internet works great now but I don't know what to do about the update. I have 4 options:
    Airport-Serviceprogram 5.3.2 , Remote Desktop Client, Quicktime, Itunes, Combo-Update to 10.5.5
    But I am afraid of updating to 10.5.5. I would do that but I don't have any option about airport updates that go with that to uncheck. Or do I just have to uncheck the first thing and am going to be fine with installing the 10.5.5 update?

    BigWaveSurfer wrote:
    I just need a way to update my computer to 10.5.5, but leaving all airport related updates out, so my Aiport won't have the same problems again.
    Do you know now what I mean?
    Yes, I doubt your issue was with 10.5.5 as my Airport and most others work well in 10.5.5. The Combo Update is the safest way to assure that your system is trouble-free. While I understand your reticence, it's best to get it ironed out. That said, you should always have a backup. Make a SuperDuper clone or, CarbonCopy Cloner clone before you begin. Then if anything untoward happens, you have the clone to restore.
    -mj

  • Confused about static thread safe.help me

    sample codes look like follows:
    public static class test
          public static method1(Object obj)
                //some operations  
    }my question is that is method1 is thread safe?

    Thread safety isn't about methods and it isn't about static. It's about being carefully about access to resources which may be accessed by more than one thread, and in particular may be changed by one thread and accessed by another.
    Local variables are always thread safe, and there's no problem about serveral threads executing the same block of code concurently.
    Thread safety is, in particular, about data items that are linked in some way so that there can be problems if one thread updates one piece of data on the basis of an out of date version of another.
    Databases are, generally, designed to cope with that kind of thing.

  • My iPhone 3G has a fault line in a multi touch screen, this does not answer some of the letters on the keyboard, I need help I can do?

    Mi iphone 3G tiene una falla en una linea de la pantalla multi tactil, esto hace que no responden algunas de las letras del teclado, necesito ayuda que puedo hacer?

    Hola,
    I don't think there's much you can do on your own, I think it needs repair & likely screen replacement.

Maybe you are looking for

  • Problems with SubMenus

    Hi all... I have a Menu called ActionEvents which has a JMenu called mouseEvents. What I want is to add a submenu to this (mouseEvents), I tried the following: mouseEvents.add(new JMenuItem("New Item"));This compiles fine but doesnt show up on the ap

  • Logic - substring cut off disapears in list

    I have one class that saves the guys Name and Social Security Number to a data file. Then another class that reads the datafile pulling in the Name and SSN into one string; String Employee=SSN + Name;. After its read I have it go into a list box, but

  • How to view data in tables by selecting the synonym from the database objec

    I could not figure out how to view data in tables by selecting the synonym from the database objects navigation tree. I had to first choose the synonym, view the details of the synonym to determine the table name, and then select the table from the d

  • Changing language in JFileChooser

    Is there any way that I can change the language of the text in JFileChooser, ie, where it says File name and File type and such. Thanks for any help you can give me.

  • HTTP 400 Bad Request error in master/detail report

    Using APEX 3.2 I have master/detail report and thought all was working fine because the detail lines were less than 100. I increased the number of lines to 300 and then when the Save or Delete buttons are pressed, we get the HTTP 400 Bad Request erro