I have implemented a JDialog and have added a checkbox apart from ok and cancel button. I have put cancel as default button and when dialog comes up, cancel is selected default and on pressing enter key, cancel operation is executed.
By pressing tab, when I reach to checkbox and press enter, it does not select the checkbox. But, on pressing space key, it gets selected.
However, switching between ok and cancel button using tab and then pressing enter, does respective actions.
Please suggest what should be done such that checkbox gets selected on pressing enter.
Key Listenerthat if thecheck boxis in focus or something like that it selects it? - 3kingsKey Bindings. - camickr