Hi,
I am just suprised when i checked the behaviour of JoptionPane confirm dialog box functionality.
Above code give us option to choose between Yes/No, When i choose the option using mouse it works fine, but when i use tab to move to the "No" option and press enter it is being treated like i have choosen "Yes" option.
I just want to know how to overcome this functionality so that whether i use mouse or Tab and then enter to choose the option.
JOptionPane works fine, but something is wrong with your program, you've got a bug, but it's likely somewhere else in code that you're not showing us. For instance, this works: