The Artima Developer Community
Sponsored Link

Java Answers Forum
JDialog doesn't respond

1 reply on 1 page. Most recent reply: Jun 21, 2006 4:36 AM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sanjay Perera

Posts: 42
Nickname: angel6
Registered: Apr, 2004

JDialog doesn't respond Posted: Jun 21, 2006 3:19 AM
Reply to this message Reply
Advertisement
Friends, I have a class which extends JDialog. I registered a KeyListener using addKeyListener() method and when a key is pressed, a message is given. But after a control is added to the JDialog (E.g a JButton), the I don't get any messages for keypresses. Why?


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: JDialog doesn't respond Posted: Jun 21, 2006 4:36 AM
Reply to this message Reply
In the method you override make sure you return focus to your JDialog after a key is pressed.

call:

dialog.requestFocusInWindow();

at the end in your keyPressed(KeyEvent evt) method.

Flat View: This topic has 1 reply on 1 page
Topic: retaining the format of the properties file while saving it from Java!!! Previous Topic   Next Topic Topic: Getting ip address of windows network

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use