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.
Thanks in advance
Joined: Feb 23, 2007
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:
Joined: Jun 13, 2009
Maybe be a version/platform difference. It doesn't work for me either on XP using JDK6_7.