KeyListener in Fullscreen App Help

I'm working on a fullscreen application in which i need to do some key binding. My class is implementing both the MouseListener interface and the KeyListener interface, I have defined all the methods contained in that interface, and I have added a KeyListener and a MouseListener to my Window. When I click the mouse, my application does everything I defined in the methods of the MouseListener. However, when I hit keys nothing happens. Does anyone know if there is anything extra that I need to do when using a KeyListener with a Window?

Hi!
I just wrote exactly what you did two weeks ago. It seems to me as if you forgot to make your object (Frame, JFrame, JLabel,...) focusable. You usually do that by calling myFrame.setFocusable(true); You can find some addidtional help in http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html where you also find a link to a pretty nice piece of code right below point 13 of "Try This[b]".
Good luck,
G :-)

Similar Messages

  • Dropping files to fullscreen apps through mission control results in app folder opening and in some sort of task switching madness

    In Snow Leopard I got used to attach documents in mails by dragging and dropping files from the desktop to the message window. To do so  I used active corners (spaces, exposé). Now, with Mission Control in Lion I've tried to keep that workflow but this leads me to an awkward problem. To reproduce it in my computer I do the following:
    Pick up a file from the desktop --> drag it to lower right corner (opens mission control) --> drag it to full screen mail space, press space to switch (applications folder opens inside mission control), and a lot of apps too (those the cursor hovered).
    At the same time, mail full screen window opens (as waiting time selected in finder preferences for triggering is short), then Lion turns crazy entering in some sort of spasmodic task switching mode, which lasts after I find some clear space to drag the file back in the desktop.
    Did any other user  experience something similar? Is there something I could do to help to fix the problem?
    Thanks for you answers.
    [Edit: Ok, so I started trying with other apps and it turns that every time I drag and drop any file to a fullscreen app in mission control and use the space key to open it, I get a similar behavior. I did it in Scrivener and it resulted in photoshop and itunes opening,  Scrivener vanished and but left an empty (like dashboard's) desktop.]
    Message was edited by: iGuybrush

    Hi,
    Thanks for your reply.
    >>Running bootcamped Win7, yes power consumption is more, a lot more,....indications are no.
    Sorry, can you clarify on this one - do you mean the power consumption is more DURING the use of Windows, or ALL of the time (even when using the Mac as normal with OSX).... also what did you mean by indications?
    >>From the parameters of what you say your use would be, Id recommend the I5 with 8gig of ram. the 12 hour >>batt. life is only rated for the 13" on the I5, ....not the I7.   
    Sounds like my first guess was about right - and good point about the battery life - as that is something that's quite important to me!
    >>The "switch" is extremely easy. Ive seen grandmothers switch to a MAC and have its 'everyday use' >>conquered in under a week. So, you should have no worries, its extremely user friendly, no worries of virus, >>etc.
    Glad to hear I've done more research and already seen a few features I can see myself preferring a lot more to the Windows system!
    >>As a former computer repairman, Ive owned nearly 200 diff. laptops (many were free, or Franken-computers >>built from parts) and I can honestly say the Macbook AIR is the finest piece of beloved hardware Ive ever >>owned by a mile.
    >>Many people incorrectly see the THIN nature of the Air and incorrectly conjecture its "less than" a full laptop, >>but the contrary is the case.
    Nah, I don't associate size with performance - especially these days, everything is getting smaller. My concerns are really just about whether to upgrade for extra performance, and using the OS - once I have those nailed I am pretty cofident the hardware will perform well.
    >>Additionally the AIR is the only Mac that has 802AC wifi, new Haswell cool-running processor, and extremely >>long 12 Hr. batt life on the I5 13" configuration.
    Yeah that battery life is one of the big sellers
    Cheers for the tips,
    Danielle

  • My iphone wont let me download apps and is telling me to put in credit card stuff for free apps help me

    my iphone wont let me download apps and is telling me to put in credit card stuff for free apps help me

    You can create a new Apple ID without using a credit card for download free apps by following this guide: http://support.apple.com/kb/ht2534.  Follow it exactly as writtien.  Note that you have to download and try to install a free app and then create the ID.

  • Is there any way to reverse the "swipe to switch between fullscreen apps" controls?

    I feel like the "swipe left to go to the app to the left" is actually counter-intuitive, especially when they were thinking about a touchscreen when designing this OS. The scrolling, though most people aren't used to it on a computer, makes sense because you move the page in the direction as if you were moving a physical page. The switching between fullscreen apps is the opposite and isn't natural for me, especially since I have been using an iPhone and iPad for a couple years now. Is there any way of reversing this control? If not, I think they should do the same thing that they did with the "natural" scrolling and have a checkbox to give you the option of either way.

    I didn't see anything in the trackpad preferences as far as direction of the swipe. If anyone else can find it, I would love to be able to reverse it.

  • I had already forgot my answer ! Now I can't purchase any app, help ! Thanks!

    Hi,I want to buy some apps today.
    While I was ready to purchase , the store ask me to answer my security questions.
    But I had already forgot my answer !
    Now I can't purchase any app, help ! Thanks!

    Read this:
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312

  • Mouse Too Sensitive in Fullscreen Apps

    Normally on the XFCE4 desktop my mouse is perfect (using Synaptics driver on my Lenovo Ideapad S205) but if I open any fullscreen apps such as ScummVM, the mouse suddenly becomes incredibly sensitive and moves far too fast (and quite inaccurately too, making it hard to select some things as if the mouse is suddenly operating as a very low DPI).
    This is just inside the app, if I leave the fullscreen program then the mouse if fine again.
    Has anyone else experienced this before and does anyone know of a fix?

    I would guess that it's a bug in SDL, and check the SDL bugzilla.
    Also check the xorg bugzilla re synaptics bugs, 'cos Arch uses bleeding-edge xorg (I'm still on xorg-server 1.9.5 with patches pinched from Fedora and Mageia, because I found 1.10.x unstable).

  • Are there keyboard shortcuts for switching to desktops with fullscreen apps?

    Coming from SL, one functionality that I used a lot was keyboard shortcuts to go to different applications.
    For instance, I had assigned Mail to Space 2, iTunes to Space 3 etc.
    Then it was possible to instantly go to Mail by pressing alt-2, to iTunes with alt-3 etc.
    In Lion, it is possible to assign Applications to desktops, and use the same commands to go to these desktops. However, as soon as an application is 'fullscreened' it leaves its previous desktop, and cannot be reached with the old keyboard shortcuts.
    My question:
    is it possible to create a keyboard shortcut to switch to a desktop containing a fullscreen app?

    This is quite possible. The way to do it is with keyboard shortcuts. If you check the appropriate boxes you can use a keyboard combination of Control and the Desktop #. It makes it very easy to swtich between desktops.

  • How will Find my iPhone app help me track my iphone if someone has disabled the location services which doesnt require an unlock code?

    How will Find my iPhone app help me track my iphone if someone has disabled the location services which doesnt require an unlock code?

    You can't, and the same if the thief turms off the phone.
    What to do if your iOS device is lost or stolen
    Reporting a lost or stolen Apple product

  • HT5312 Hi,I want to buy some apps today. While I was ready to purchase , the store ask me to answer my security questions. But I had already forgot my answer ! Now I can't purchase any app, help ! Thanks!

    Hi,I want to buy some apps today.
    While I was ready to purchase , the store ask me to answer my security questions.
    But I had already forgot my answer !
    Now I can't purchase any app, help ! Thanks!

    The HT5312 page that you posted from has instructions for how to reset them i.e. if you have a rescue email address (which is not the same thing as an alternate email address) on your account then steps 1 to 5 half-way down that page should give you a reset link.
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact Support in your country to get the questions reset (these are user-to-user forums).
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 page that you posted from to add a rescue email address for potential future use

  • Hi,I want to buy some apps today. While I was ready to purchase , the store ask me to answer my security questions. But I had already forgot my answer ! Now I can't purchase any app, help ! Thanks!

    Hi,I want to buy some apps today.
    While I was ready to purchase , the store ask me to answer my security questions.
    But I had already forgot my answer !
    Now I can't purchase any app, help !  Thanks!

    The HT5312 page that you posted from has instructions for how to reset them i.e. if you have a rescue email address (which is not the same thing as an alternate email address) on your account then steps 1 to 5 half-way down that page should give you a reset link.
    If you don't have a rescue email address (you won't be able to add one until you can answer your questions) then you will need to contact Support in your country to get the questions reset (these are user-to-user forums).
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 page that you posted from to add a rescue email address for potential future use

  • Order of the fullscreen apps?

    I want to re-arrange the order of the fullscreen apps that are open. Anyone know how to do this??

    I see your problem. Unfortunately, posting on this forum does not contact apple directly. I urge you to submit feedback at http://www.apple.com/feedback/macosx.html.

  • Screen off-center after waking. Happens to login and fullscreen apps.

    When I wake my MBP up the screen is offcenter by a few inches resulting in this happenening. http://imgur.com/OGwWs
    This happens to my fullscreen apps and my login screen but that is it. When I un-fullscreen and fullscreen again it goes back to normal.

    Hi,
    Regarding current information, please check if the video card drivers are up to date. Install the latest video card drivers for Windows 7.
    Tips for fixing common driver problems:
     http://windows.microsoft.com/en-US/windows7/Tips-for-fixing-common-driver-problems
    I would suggest you to run the Power troubleshooter to adjust your computer's power settings, and check if it works properly.
    Here are the steps:
    1. Open the Power troubleshooter by clicking the Start button , and then clicking Control Panel.
    2. In the search box, type troubleshooter, and then click Troubleshooting.
    3. Under System and Security, click Improve power usage.
    If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
    For more information, logon to:
    http://windows.microsoft.com/en-US/windows7/Open-the-Power-troubleshooter
    http://windows.microsoft.com/en-us/windows7/Sleep-and-hibernation-frequently-asked-questions
    How to troubleshoot performance issues with standby, hibernate, and resume:
    http://support.microsoft.com/kb/950686
    Note: The article holds good for Windows 7 as well though it is for Vista.
    Kate Li
    TechNet Community Support

  • My iphone four screen does not work and in order to restore it i have to turn of the "find my iphone" app. help!!!

    my iphone4 screen does not work and in order to restore it i have to turn of the "find my iphone" app. help!!!

    It is not the app, it is Find My iPhone enabled with your iCloud account settings on the iPhone.
    http://support.apple.com/kb/ph2702

  • In App "Help" "User Guide" etc

    When working in Illustrator CC can I restrict "Help" to entering queries about Illustrator CC only? I have used Illustrator since 1988, but need occasional info on new/changed features. I just entered "Live Corners" under Help and got nothing. But other attempts have offered info on OSX, and various Apple features. And when I try Adobe support Center, simple searches often yield links to videos, discussions etc.
    Is it not possible to access a traditional User Guide where specific features can be searched, and explained concisely?
    I'm guessing that in app Help is really a portal provided by the OS. But other complex (Mac based) apps I use allow me to use a Help pulldown, and simply search for current app specifics. Can't the search be restricted to the app I'm currently using - i.e. Illustrator?
    And is there a simple online "User Guide" or knowledge base that concisely covers use/features and is not a portal to the web at large?
    thanks

    Search help using Google.
    Enter the search term "adobe illustrator help" followed by the topic e.g. "live corners"
    Usually the first entries in the list are pages from the manual.

  • Mac OS X Fullscreen App for Creative Cloud

    I wanted to know if there is plan to make a fullscreen app feature for Mac OS X. I know you guys have the "F" button to change appearance of the UI but it is better to work on fullscreen app with seperate desktops.

    Well, I found out a couple of things.
    A nice person from Apple reported that my app must have been built on a PPC Mac. That is very true ... I never even thought to check that little checkbox in XCode that builds code as Universal. So I did that.
    Problem is that on an Intel Mac, the generated string is no longer cool. I "suspect" that the culprit may be in the SHA-256 C routines Apple provided us (and upon which my code is based). There's a lot of hex in there ... so there could be a lurking endian issue buried deep insde the code. I'm checking into that.
    For now, I would say, stick with Rosetta when running the app.
    Also, a number of people asked for user-interface tweaks. I'll make them.
    MacBook Pro   Mac OS X (10.4.8)   I lied. I'm running Leopard

Maybe you are looking for