Results 1 to 6 of 6
  1. #1
    aslanali555 is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default KeyListener isn't working while jFrame not active

    How can I work keylistener while jFrame not active. Please help me.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,924
    Rep Power
    4

    Default Re: KeyListener isn't working while jFrame not active

    Hmm, logically, I would think you can't (but I could be wrong). How can something that is not visible or doesn't have the focus accept keyboard input? I would think that could be a security nightmare. Imagine you are typing in a password and you expect some other application on the same platform to read your keystrokes. Or perhaps I am not understanding what you are asking.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    aslanali555 is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default Re: KeyListener isn't working while jFrame not active

    Quote Originally Posted by jim829 View Post
    Hmm, logically, I would think you can't (but I could be wrong). How can something that is not visible or doesn't have the focus accept keyboard input? I would think that could be a security nightmare. Imagine you are typing in a password and you expect some other application on the same platform to read your keystrokes. Or perhaps I am not understanding what you are asking.

    Regards,
    Jim
    I want to listen key events. while jFrame is not active. What should I use.
    How I can listen key events while jFrame not active.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    2,924
    Rep Power
    4

    Default Re: KeyListener isn't working while jFrame not active

    Perhaps if you explain why you want to do that I or someone else can offer a different approach.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,691
    Rep Power
    8

    Default Re: KeyListener isn't working while jFrame not active

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: KeyListener isn't working while jFrame not active

    Short answer: you can't write spyware in Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. KeyListener is Not Working
    By Prime624 in forum New To Java
    Replies: 7
    Last Post: 04-16-2013, 08:00 AM
  2. KeyListener not working
    By cc11rocks in forum AWT / Swing
    Replies: 3
    Last Post: 02-09-2011, 01:09 PM
  3. How do i open JFrame in the same active window
    By Jkiller295 in forum AWT / Swing
    Replies: 35
    Last Post: 06-02-2010, 04:50 PM
  4. Replies: 4
    Last Post: 04-22-2009, 11:02 PM
  5. keyListener isn't working for me
    By lost_in_java in forum AWT / Swing
    Replies: 7
    Last Post: 12-05-2008, 04:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •