Where do I put my KeyListener ?

I've got a JInternalFrame with a JPanel and JToolBar added to it. I want to add a key listener so when the user pushes + or -, a method is called on the JPanel. A screenshot is available below -- the colored boxes are JLabels.
http://www.enginuity.org/viewtopic.php?p=245#245
Can anyone tell me what component to put my KeyListener on? It'll need to work when, say, the cursor is in one of the JTextAreas in the toolbar, or whatever.. basically whenever any component in that frame is selected, and without interfering with any of the obvious functionality already present. Thanks!

Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]How to Use Key Bindings. You should be creating Actions and binding the Action to a KeyStroke instead of using a KeyListener.
It'll need to work when, say, the cursor is in one of the JTextAreas Well, by default if focus is on a textArea then the "+" or "-" will be inserted into the text area. If you don't want this to happen then you will need to remove the default Action from the text area.
This posting shows how this can be done:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=622030

Similar Messages

  • TS1702 i have an issues everytime i put my apple id and password to face time and imessage he said verifying and he goes back to where u should put ur password and wont check mark the mail and i create a new apple id the same what should i do ?

    i have an issues everytime i put my apple id and password to face time and imessage he said verifying and he goes back to where u should put ur password and wont check mark the mail and i create a new apple id the same what should i do ?

    i have an issues everytime i put my apple id and password to face time and imessage he said verifying and he goes back to where u should put ur password and wont check mark the mail and i create a new apple id the same what should i do ?

  • When I receive appointments by email and accept them they go into the enourage "on my mac" ical calendar which is not synced with mobileme.  How do I change where appointments are put ?

    When I receive appointments by email and accept them they go into the enourage "on my mac" ical calendar which is not synced with mobileme.  How do I change where appointments are put ?
    Or how can I choose where the appointment is put ?
    I use the mobileme sync services so the ical calendars that are synced are those in the "[email protected]" group.
    Please help !
    Nick

    Actually you can't drag the appointment to ano calendar - its says "You can’t make changes to this invitation., Only the organiser can change this event"
    Also if you double click on the received appointment and open the window the only calendars shown that you can select are the 'on my mac" ones, and not the sync'd ones.
    Any ideas welcome !!
    Nick

  • I got a new laptop and I can't sync all my music onto iTunes without iTunes saying it will erase my songs on the phone, how do I fix this to where  I can put all my music on my laptop?

    I got a new laptop and I can't sync all my music onto iTunes without iTunes saying it will erase my songs on the phone, how do I fix this to where  I can put all my music on my laptop?

    If you do not have access to the iTunes Library on your Old computer... or its Backup...
    See these 2 Links...
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991
    If you do have access... See Here...
    iTunes: How to move your music to a new computer

  • Where do I put a workflow so that all users on the Mac can access?

    Where do I put a workflow so that all users on the Mac can access it from Automator?
    Also. why does the search pattern "users" AND "workflows" return results whitch math "and" (lowercase)? I thought "AND" (in caps) is for boolean searches.

    Hi, Mike.
    1. You wrote: "Where do I put a workflow so that all users on the Mac can access it from Automator?"Either:
    • Macintosh HD > Users > Shared
    • Macintosh HD > Applications (if you're the Admin user).
    All users (unless restricted by Parental Controls) have access to those folders.
    2. You wrote: "Also. why does the search pattern "users" AND "workflows" return results whitch math "and" (lowercase)? I thought "AND" (in caps) is for boolean searches."It's unclear as to what search facility you are referring, and a bit hard to follow given the spelling errors in your question.
    Do you mean Discussions search? If so, have you reviewed the Search Tips? They're also available from the search page, where one can click "Tips" under the Search Terms field.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • I want to create a "Play All" chapter marker that will play the video from start to finish in addition to the standard chapters I have-I guess I can auto start the DVD but would prefer a button-how and where would I put this "play all" marker??

    I want to create a "Play All" chapter marker that will play the video from start to finish in addition to the standard chapters I have…I guess I can auto start the DVD but would prefer a button…how and where would I put this "play all" marker?? Thanks..

    The start chapter button is a play the whole movie button regardless of how many other markers you have.
    Once a DVD starts playing it continues to the end.
    Chapters marker simply gives the viewer a place to start playback whether it be the start, middle or near the end.
    Al

  • My ipad was in recovery mode and it went back to the home screen and it found my info on itunes to the point where i can put music on it but it still says connect to itunes

    my ipad was in recovery mode and it went back to the home screen and it found my info on itunes to the point where i can put music on it but it still says connect to itunes

    sarahwood wrote:
    .. it said my iPod was in recovery mode and I needed to restore it?
    Once the Device is asking to be Restored with iTunes... it is too late to save anything...
    See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...
    Be sure to Follow ALL the Steps...
    To minimise loss... after the successful Recovery... Restore from the most recent Backup...
    See Restore from Backup here
    http://support.apple.com/kb/ht1766

  • Where do I put the "autoplay" code in my photo gallery?

    I have a photo gallery on http://victorylcms.org/photos.html. I'm trying to add "autoplay" to it.
    I got the gallery from http://galleria.aino.se/ and here is what it says to add http://galleria.aino.se/docs/1.2/options/autoplay/, but I can't seem to figure out where exactly to put it in my code to make it work properly. Thanks for any help!
    autoplay
    type: Boolean or Number
    default: false
    If true, this will start playing the slideshow with 5 seconds interval (default). If you set this to any number, f.ex 4000, it will start playing with that interval (in milliseconds)
    Example:
    $("#gallery").galleria({
        autoplay: 7000 // will move forward every 7 seconds

    I got the gallery from http://galleria.aino.se/
    There's a support forum for that gallery
    http://getsatisfaction.com/galleria/
    here is what it says to add http://galleria.aino.se/docs/1.2/options/autoplay/, but I can't seem to figure out where exactly to put it in my code to make it work properly. Thanks for any help!
    autoplay
    type: Boolean or Number
    default: false
    If true, this will start playing the slideshow with 5 seconds interval (default). If you set this to any number, f.ex 4000, it will start playing with that interval (in milliseconds)
    Example:
    $("#gallery").galleria({
        autoplay: 7000 // will move forward every 7 seconds
    Look for similar code in your page
    e.g. line 182
    <!--begin init code for the galleria pics slideshow-->
    <script>
    $('#gallery').galleria({
      autoplay: 7000 // will move forward every 7 seconds
      width:640,
      height:480
    swfobject.registerObject("FlashID");
    </script>
    <!--end init code for the galleria pics slideshow-->

  • Where should I put trustedprincipal.conf in

    Hi experts,
    We have BOE XI 3.1 in our server.
    We configured trusted authentication in CMC of our server machine, and created a trustedprincipal.conf in D:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 of my client machine. I created a jsp file to access bo reports.
    I can not approach http://bfphp:8080/OpenDocument/opendoc/openDocument.jsp, just get alert after running the jsp file.
    However, we put trustedprincipal.conf in our server machine and remove the file from my client machine, I can approach openDocument.jsp after accessing the jsp file.
    Official document says trustedprincipal.conf should be put in client, but we tried it, logon fails. When I put it in server, logon succeeds.
    My question is, if trustedprincipal.conf is put in server, can anyone who knows a user of BO system access to bo system via the jsp file. So how can I control authentication of client who access to BO system, and where should I put trustedprincipal.conf in?

    HI,
    this sounds like a general BusinessObjects Enterprise configuration topic. this forum here is for the Integration Kit for SAP.
    Ingo

  • Where do I put my SD card in MacBook Pro

    Hi, 
    This may be a really stupid quesiton but I am stuck! 
    Where do I put my Scandisk memory card in the MacBook Pro? 
    I don't seem to have a slot anywhere. I am probably being very stupid!!!
    Please help.  Thanks

    You might have one of the 'micro' cards that needs a standard SD adapter - I have a 4GB of one of those in my phone, but it came with an adapter. My camera SD cards are standard size and they fit right into the card reader and show up on my desktop.
    Look for an adapter on Amazon.
    Good luck,
    Clinton

  • Where should a put FCP?

    I have been reading FCP for dummies, watching tutorials and reading the directions before installing the program. Now that I am about to install I remembered reading or hearing to install it in a certain place.
    Should I install the application on my main dirve where the OS and Applications folder is or on a seperate brand new internal drive where I intend to put my video files as I load them from DV tape?
    I was thinking it best to do the later but I want some input. If I should put FCP Studio on the newer seperate drive where do I put it? Do I make a new "applications folder" on this drive or just dump it on there anywhere?
    Thanks for the help.

    Captain,
    Yes, I was taught the same thing about project files. Then I worked for/with some of the folks associated with this group...
    http://www.creativeanimal.nl/files/eng/about.pdf
    http://www.creativeanimal.nl/files/eng/technical.pdf
    They all know what they are doing in a big way, and they were organizing the disks they were traveling from system to system, location to location, in the way I described above. I've working this way for several months without issue. That doesn't mean I won't in the future, though!
    OK, captured material.
    My client showed up with a UVW-1400 deck, when I was told it would be a DVW-A500. I own a AJA IO with 422 control. No such thing on a 1400. There are conversion options that might have worked, but I was on the side of a mountain in the Adirondacks.
    No deck control equals no time code equals you lose your media, you start over.
    Happily, I do travel extra firewire drives with me. I backed up my capture scratch every evening, in addition to the project, etc. I incremented the project name each day so I could avoid duplication - in my capture scratch folder I had incrimented folders repressenting my captures from day 1, day 2, etc.
    I'm going to look into alternative ways of controling 25-pin RS-223C, from my 9-pin controller on IO. I'm not knowledgeable about this.
    Love your story about the Mother's Day Project!
    The project I refered to was a documentary about my son's kindergarten, that some how went from, vhs, imovie, and an imac to eight days of shooting with an xl-1, buying a media drive and learning FCP 1.2.
    It was a difficult day when I learned about the not so nice relationship between Canon DV and FCP.
    It was a difficult day when the project would not open.
    It was a difficult day when the system drive on the imac started to make the funny little sounds just before it ground to a halt.
    No wonder I stepped away until version 4.5!
    Tom

  • Where do i put external libraries?

    I have some oracle classes that I use for XML generation. Where do I put the jar file so that
    Weblogic can use them? Do I reference it in the CLASSPATH variable, or can I put the jar file in the
    weblogic directory structure?
    Thanks in advance,
    Josh Cimino
    Software Developer
    Mxi Technologies Ltd.
    1430 Blair Place, Suite 800
    Ottawa, ON, Canada
    K1J 9N2
    E: [email protected]
    T: 613.747.4698 ext 479
    F: 613.747.1909
    www.mxi.com
    "From the flight line to the bottom line"
    [att1.html]

    Thanks!
    "Dimitri Rakitine" <[email protected]> wrote in message
    news:[email protected]..
    http://www.onjava.com/pub/a/onjava/2001/06/26/ejb.html
    Josh Cimino <[email protected]> wrote:
    What if I have a session bean that uses external libraries? There is no
    web-inf/lib directory for an EJB.
    "Renaud Waldura" <[email protected]> wrote in message
    news:3bd348b5$[email protected]..
    If your application is packaged correctly it should be in WEB-INF/lib.
    If
    not, well, let's just say it's probably worth your time to package it
    correctly. I know it sounds harsh, but really it's worth it.
    --Renaud
    "Josh Cimino" <[email protected]> wrote in message
    news:3bcaf5f6$[email protected]..
    I have some oracle classes that I use for XML generation. Where do I
    put
    the jar file so that
    Weblogic can use them? Do I reference it in the CLASSPATH variable,
    or
    can
    I put the jar file in the
    weblogic directory structure?
    Thanks in advance,
    Josh Cimino
    Software Developer
    Mxi Technologies Ltd.
    1430 Blair Place, Suite 800
    Ottawa, ON, Canada
    K1J 9N2
    E: [email protected]
    T: 613.747.4698 ext 479
    F: 613.747.1909
    www.mxi.com
    "From the flight line to the bottom line"
    Dimitri

  • Where do I put all my service classes?

    I am new weblogic server environment. I want to know where do I put all my service classes? I am deploying all my servlet in WEB-INF/classes directory (under the context root) but donot know where to put the service classes. (The service classes have the jdbc and sql code in them. They are like simple java beans. I don't have any sql in the servlet classes).

    <p>Hello,</p>
    <p>If the only other classes that use your service classes are in your webapp then putting them under WEB-INF/classes is perfectly acceptable, you might want to wrap them up in their own jar file and stick them under WEB-INF/lib, it is up to you.</p>
    <p>
    Hussein Badakhchani</br>
    </p>

  • May be the stupidest question, but anyway - where do I put my libraries?

    So, I download the Java Activation Framework, MAIL api, beanshell, etc. I get a nifty directory with not only the JAR but the javadocs etc.
    Where do people put these things on MAC OsX? I'm sure there's a best practice based on standards for where things go in unix.

    You put them whereever you like to have them, and add them to your classpath...

  • Where do I put my beans?

    With a default installation of IAS 1.1 and relative to Oracle_Home, where does one put .class files for Java beans? And what is plan B when that doesn't work?

    Just to clarify, the CLASSPATH doesn't need to point there to run Tomcat.
    Tomcat has its own idea of Classpath, seperate from the system one.
    The ONLY reason I could think of to point the classpath at the directory here, is if you were compiling a class with dependencies on classes you have already compiled. Normally you don't need it.

Maybe you are looking for