Hi,
I am working on an MDI application using JInternalFrames. I have
forms to fill that have the 'Next', 'Back' and 'Cancel' buttons. I am
assigning key presses (Enter, Alt+left and Esc respectively) through
KeyRelease event. In addition, the 'Next' button is assigned as the
default button using
this.getRootPane().setDefaultButton(btnOK). However, I find that when
I run the program and press the Enter key, after accepting the enter
and processing the button action, it loads the next JInternalFrame and
appears to call the KeyRelease event for this form too. Since I have
entries that must be filled, this raises errors that entries are not
filled.
Can anyone tell me what I am doing wrong.
Thanks in advance,
Arun Kumar Srinivasan
Ryan Stewart - 08 Jan 2004 12:38 GMT
> Hi,
> I am working on an MDI application using JInternalFrames. I have
[quoted text clipped - 11 lines]
> Thanks in advance,
> Arun Kumar Srinivasan
I've never worked with them myself, but my guess would be that the
setDefaultButton method makes the button listen for a KeyPressed event.
Therefore, you press Enter, and btnOK reacts to the KeyPressed event, which
causes it to load the next frame. Then you release Enter, and your code
catches this release and processes it.