JPanel can't receive KeyEvent?

Hi,
I have add a KeyListener to my JPanel,but methods of the listener does not invoked when keyboard is typing.
Is JPanel can't receive KeyEvent?

try add a overlay method:
public boolean isFocusTraversable() { return true;}

Similar Messages

  • JPanel can't receive key events

    I have a single JPanel added to the content pane of a JFrame.
    I want to itercept key events by adding a KeyListener to the JPanel.
    If I do it, I don't receive key events.
    To solve the problem I identified two ways:
    - add the KeyListener to the JFrame's content pane
    - invoke setFocusable(true) on the JPanel (available only since 1.4)
    I can't use the former because I want to bind the the KeyListener to the JPanel, and I can't use the latter because I don't want to have dependencies on jdk 1.4.
    Can anyone suggest a way to solve the problem as simple as calling setFocusable() but available also for older versions of java?

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class KeyListenTest {
         public static void main(String[] args) {
              JPanel panel = new JPanel();
              panel.addKeyListener(new KeyAdapter() {
                   public void keyTyped(KeyEvent e) {
                        System.out.println(e);
              JFrame frame = new JFrame();
              frame.getContentPane().add(panel);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(400,300);
              frame.setVisible(true);
              panel.requestFocus();
    }The panel must be displayable and visible, so you have to make the call after frame.setVisible(true), however if you don't have any other components that will take the focus away from your panel, this should do it for you. If you want the use to be able to shift focus to your panel, then just add a mouse listener to the panel with a mousePressed(MouseEvent) method that calls the requestFocus() method on the panel.

  • Can not receive data 10054

    My version of Essbase is 6.5.1.4. On the server machine it self when I am adding members to outline I get "Can not receive data 10054". To resolve this problem I tried to increase the server page file size but the problem persist.Does anyone know a solution to this problem?SAK

    How exactly are you retrieving data; is it smartview, excel addin, forms, reports etc ?

  • Can not receive Mac mail -error Outlook cannot find the server. Verify the server information is entered correctly in the Account Settings, and that your DNS settings in the Network pane of System Preferences are correct.  Account name: "MacMail"

    Can not receive Mac mail -error Outlook cannot find the server. Verify the server information is entered correctly in the Account Settings, and that your DNS settings in the Network pane of System Preferences are correct.  Account name: "MacMail"
    What are the correct mail account settings and more importantly the correct DNS settings
    Thank you for any help you may be able to provide
    Cheers
    Chris (iMac i7)

    Do not delete the old account yet. sign up for an iCloud account if you haven't.
    I understand .mac mail will still come through. Do not delete the old account yet.
    You cannot use .mac or MobileMe as type of Account, you have to choose IMAP when setting up, otherwise Mail is hard coded to change imap.mail.me.com to mail.me.com & smtp.mail.me.com to smtp.me.com, no matter what you try to enter.
    iCloud Mail setup, do not choose .mac or MobileMe as type, but choose IMAP...
    On second step where it asks "Description", it has to be a unique name, but you can still use your email address.
    IMAP (Incoming Mail Server) information:
              •          Server name: imap.mail.me.com
              •          SSL Required: Yes
              •          Port: 993
              •          Username: [email protected] (use your @me.com address from your iCloud account)
              •          Password: Your iCloud password
    SMTP (outgoing mail server) information:
              •          Server name: smtp.mail.me.com
              •          SSL Required: Yes
              •          Port: 587
              •          SMTP Authentication Required: Yes
              •          Username: [email protected] (use your @me.com address from your iCloud account)
              •          Password: Your iCloud password
    Also, you must upgrade your password to meet the new criteria:  8 characters, including upper and lower case and numbers.  If you have an older password that does not meet these criteria, when you try to setup mail on your mac, using all of the IMAP criteria listed above, it will still give a server error message.  Go to   http://appleid.apple.com         then follow directions to change your password, then go back to setting up your mail using the IMAP instructions above.
    Thanks to dpepper...
    https://discussions.apple.com/thread/3867171?tstart=0

  • I can not send email from my iPad .  Have been using it for over a year, all of a sudden I can only receive email.  I have a wifi connection in my home and have a A T &T cellular data plan?

    I can not send email from my iPad .  Have been using it for over a year, all of a sudden I can only receive email.  I have a wifi connection in my home and have a A T &T cellular data plan?

    I have a 1st gen iPhone that I just updated the software to 2.0.2
    Now whenever I press the mail icon it goes to the mail app for about 4 seconds, does nothing, no loading of folders, old messages, nothing.
    Then it reverts back to the home screen. Tried restarting, haven't tried restoring, thought I'd look here first.
    Anyone???

  • My wife recently switched from an iPhone to a Samsung and she can send text messages but she can't receive texts or emails. Any suggestions?

    My wife recently switched from an iPhone to a Samsung and she can send texts but she can't receive them nor receive emails. Her iPhone has had her info removed and the settings have all been set to default. What else does she need to do to correct this?

    In particular the last link is for you
    iMesssage to old phone
    If you move to another phone and forget to turn off iMessage then read “if you no longer have the device in http://support.apple.com/kb/HT5661  If you still cannot resolve it call Apple http://support.apple.com/kb/HE57
    To deactivate iMessage http://support.apple.com/kb/ts5185
    Read http://m.samsung.com/us/support/SupportOwnersFAQPopup.do?faq_id=FAQ00053450&fm_s eq=62995

  • IPhone 4 Can't receive incoming calls and sms after 3G has been activated

    I can't receive incoming calls and sms on my iPhone 4 after the 3G connection has been activated and used actively by me. Outgoing calls and messages do work and as long as I use the Wi-Fi connection everything's fine but the problem appears after switching to 3G. Any help? Thx in advance!  

    I think the next step is to do a reset by holding the sleep and home buttons down at the same time until the Apple logo appears.  If you haven't done this before, keep holding the buttons when the turn off slider appears.  The screen will go black and after what seems like an eternity, actually several seconds, the Apple logo will appear.  When the logo appears, release the buttons.

  • TS2755 I can't receive messages on my iPhone 4?? It will let me send them just not receive, and this happens on text and iMessage. Help anyone?!

    I have a iPhone 4 on contract and every now and then it will stop receiving messages when I am in the middle of a conversation. I don't use iMessage as I sometimes go over the limit of my Internet data. So I stick with SMS. And even when I do try with iMessage I still can't receive messages. I don't know if this is a on fault on the phone but it's a really bad downfall if its common on most iPhones. Don't get me wrong but I love this phone I think it's great but it's annoying when I can't receive messages. And at this moment
    In time I still can't receive them. Been happening for 12 hours now and it's never been this long usually, advice anyone?

    Hi Tnolen15,
    If you are having issues sending or receiving messages from a specific contact (in this case, your wife), you may find this portion of the following article helpful (ignore the numbering):
    If the issue occurs with a specific contact or contacts, back up or forward important messages and delete your current messaging threads with the contact. Create a new message to the contact and try again.
    If the issue occurs with a specific contact or contacts, delete and recreate the contact in the Contacts app. Create a new message to the newly created contact and try again.
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Regards,
    - Brenden

  • TS3276 Mail account set up. Can not receive mail-Everything is green in Connection doctor but when checking activity it shows stop signs.  Was able to receive mail until last week  then all of a sudden stopped receiving mail but no changes were made.

    My mail account has been set up and working to send and receive mail for several months.  All of a sudden I can not receive mail.  The connection doctor shows all green lights.  No changes have been made and nothing has been changed on preferences on IMAP and SMTP.  I can send mail.  My other accounts all send and receive mail.  When you click on activity the list shows stop signs. All accounts show that they are online. 

    UPDATE:
    I deleted all the messages off the server of the offending email address and everything works fine now.

  • IOS 7 downloaded fine but I can't back up restored. Tried 3 times. Tried turning off iCloud. Now I can only receive texts and phone messages. I cannot make calls, retrieve phone messages or send any texts. When I try I just get a blank screen. HELP

    I initially tried to do this at 11:39pm last night. I cleaned up my apps, backed up to my computer and then took the plunge. It downloaded fine, everything went ok until I tried to restore backup. I received a message that there was an error in iTunes and iPhone could not be restored. I tried this three times giving up at 2:00 am. I tried again at 7:30am. No fix. Now I can open up phone and browse in safari. I can get notifications that a text was received or a phone message left but I can't receive or make phone calls, retrieve phone messages, or access any text features. Also I have NO purchased apps. I use my phone got work and this has ruined my day - please help!!

    I would start with going to O2 with the phone and making sure it's set up properly - maybe the SIM they gave you isn't quite right or their network isn't acknowleding it like it should.
    Seeing as you've tried restoring to factory settings and resetting network settings, I'm assuming you've tried restoring the phone as new, just to see if that helped at all. If that didn't help, you definitely need to get in touch with O2 and work things out with them.
    ~Lyssa

  • My daughter accidentally dumped my iTouch into the tub.  It is ruined.  How can I receive my one time regrant on all the songs I've lost.  There were approximately 80 songs I purchased on iTunes.  They get me through the day!  Please help!

    My daughter accidentally dumped my iTouch into the bath tub.  It is ruined.  How can I receive my one time regrant to get back the 80 plus songs I purchased and downloaded on iTunes?  I'm devastated....please help!  My husband bought me the new iPhone4 for my new Mother's Day gift.  I would like to download all the songs I lost.  Thank you so much!

    You can redownload the songs as many times as you want, the "one time regrant" no longer exists. Make sure you are using the same apple id on both your dead itouch and your iphone 4. On your iphone 4 go to the itunes app > Purchased (may be under more based on your settings) at the top click not on this iphone, click all songs then click the little cloud next to each song you want to redownload. It will prompt you for your id and password and the begin your download

  • I want to delete my mobile me account not just from my iPhone but from existence. I want to delete it so that no emails can be received to it, and the sender would receive an undeliverable message. Is this possible?

    I want to delete my mobile me account not just from my iPhone but from existence. I want to delete it so that no emails can be received to it, and the sender would receive an undeliverable message. Is this possible?

    No, you can stop using the account, but you cannot delete it.

  • HT1277 I have followed this to the letter for an email account that I needed to manually configure and I am still unable to send mail even though I can now receive it.  I have gone through exactly the same process with my iPhone and there seems to be no p

    I am trying to configure my macbook pro to allow mac mail to send and receive via pop and smtp.123-reg.co.uk.  I have managed this today on my iphone but still can only receive but not send from my laptop  Any sugestions?

    Hi mopster555,
    Thanks for the question. If I understand correctly, you are not receiving messages on two iOS devices. I would recommend that you read this article, it may be able to help you isolate or resolve the issue.
    iOS: Troubleshooting Messages - Apple Support
    Thanks for using Apple Support Communities.
    Have a great day,
    Mario

  • TS4268 I CAN NOT RECEIVE TEXT MESSAGES FROM PEOPLE USING IMESSAGE - I HAVE MY IMESSAGE TURNED OFF BECAUSE I DO NOT WANT TEXTS GOING TO ALL MY ACCOUNTS - HOW DO I RESOLVE THIS PLEASE HELP - MISSING SEVERAL IMPORTANT COMMUNICATIONS...

    I CAN NOT RECEIVE TEXT MESSAGES FROM PEOPLE USING IMESSAGE

    On an iPhone your iMessages will go to your phone number.
    You can select another email to use on iPod or iPad.
    Go to settings
    Messages
    Send and receive
    Check your phone number and uncheck the common Apple ID you share so your messages will not go to other devices.

  • I forgot my icloud password and i also lost my email account password, so i can´t receive an email to restore my account, what can i do?

    hi i need to solve this problem becasue i was working for a company and i used to the email from my work but i left the job and i lost the email, so i try to deactive the icloud but i forgot the password and i can´t receive an email confirmstion to restore this because y also lost the work email, please if anybody could tell me how i can erase my old user and activate the new i´ll be very grateful
    my new email is [email protected], thanks

    If you don't know your password, don't know your security questions and don't have a rescue address or don't receive a reset email, you should contact AppleCare who will initially try to assist you with a reset email or if unsuccessful will pass you to the security team to reset your security questions for you.
    If you are in a region that doesn't have international telephone support try contacting Apple through iTunes Store Support.

Maybe you are looking for

  • SQL Tunning

    I am having one batch job in which query fatching data from various tables and inserting in one table. It's taking 3-4 hours. On generating explain plan i come to know that query taking more time due to one outer join between one view(say V1) and lar

  • I'm having problems with Outlook for the Mac, anyone else?, I'm having problems with Outlook for the Mac, anyone else?

    I have recently purchased a Mac.  I'm very dissapointed at the way Outlook 2011(the newest version, what?!?)interfaces with the Mac.  I used the contacts feature all the time when I had a microsoft system.  Now, I can't do that with Outlook for the M

  • Premiere Elements 4 does not add entire video clip

    Hi, I have Premiere Elements 4 and have been using it for years. I just captured a 15 minute movie and it will only play the first 66 seconds of the video. It shows the entire 15 minutes in the timeline, shows the file being 0.99GB, but simply goes b

  • Allow only one domain name

    Hello, my organisation use 2 domain name for internal and external mails (abc.ca et xyz.ca). Some users should be able to send and receive mails just to users in the same domain. is it possible ? I tried a long time to create rules, but anything didn

  • My Elements 8 was not working OK so I reinstalled it off CD. Will not install

    Elements 8 was not working OK so I reinstalled it off CD. Will not install and says installation interrupted. Try again  - OK  - no go. Also lost initial installation so I now have no Elements 8!!!