Hi all,
I am having one dialog in my application which is having few buttons. I want to set one button as default button so that when the dialog is active, hitting enter key should result in action triggerd for a specific button in the dialog even if the button doesnot have keyboard focus.
I tried with following code in my dialog:
this.getRootPane().setDefaultButton(buttonObj);
But i havent got what i expected. On hitting enter key, the button which has keyboard focus triggers event not the default button i set.
Can anyone help me to get my desired bahaviour?
Note: I am using default
java look and feel.