dcsimg
JDialog
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Maheshwar_Reddy
Posted On:   Thursday, September 6, 2001 04:55 AM

hello everyone,

How do i catch the escape sequence for the dialog so that when the esc key is pressed on my keyboard the dialog disappears.

Regards,
Maheshwar.

Re: JDialog

Posted By:   John_Wang  
Posted On:   Thursday, September 6, 2001 06:41 AM

Please implements KeyListener.
Actually, if you want to capture ESC key,
you must do it in method keyPressed().
Please note, only this method
knows function key from keybord.
So, if you want to capture ESC,
F1--F12 or something like this,
you will be failed.


If you want to hide the dialog,

just use condition check in method

keyPressed() and if ESC pressed,

call myDialog.dispose() or something.
About | Sitemap | Contact