Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Esc key event for disposing JDialogs.  RSS feed

 
Neha D
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • 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.....
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Brian Dienes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

Great job on this code.

This has solved my ESC key question for JDialog.

Thanks again!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!