• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Esc key event for disposing JDialogs.

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I wanna implement the Escape key event for all the dialog boxes in my applet. I have given the key event listener on all the dialogs wherein if the key code is VK_ESCAPE then I dispose that particular dialog.

This works fine for some dialogs, also fine for dialogs which have text fields & text areas on it & these components having the focus. But the problem is for dialogs having JTables on it. If the focus is on the table then esc key doesnt work for the dialog. Even for the combo boxes as conbo boxes do not have key event handlers.

But I need to fix this problem for dialogs containing tables.

Can anyone plz suggest me a solution for this problem.

All help is appreciated.

Thanx.

Neha.....
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.

Great job on this code.

This has solved my ESC key question for JDialog.

Thanks again!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic