I want to invoke the keyListener and get the keyCode while the dialog is being shown. I have tried extending Dialog and overrided the keyReleased() with no success. Below is my code, what went wrong?
public class MyDialog extends Dialog{
public void keyReleased(int keyCode) {
super.keyReleased(keyCode); //To change body of generated methods, choose Tools | Templates.
System.out.println("Keycode in Dialog: "+keyCode);
}
}
And in my form, I am using the custom Dialog like below:-
MyDialog dialog = new MyDialog();
dialog.show("INFO", "TEST CONTENT", "OK", "CANCEL");