I'm using JOptionPane to show a confirmation dialog with the
JOptionPane.YES_NO_OPTION, so that the dialog appears with a Yes button and
a No button. It works just fine when I hit either button with the mouse.
I notice that when I hit the tab key, the "highlight" (the outline around
the word "Yes") moves from the Yes button to the No button, but the bold
outline on the Yes button does not move. This suggests to me that the tab
key has not really changed which button is selected (although the visual
cues are deceptive).
When I hit the return key, the dialog returns as though I had hit the Yes
button with the mouse, regardless of which button I have "tabbed" to
(regardless of which button has the outline around the button text).
I see the same behavior when I use JOptionPane.YES_NO_CANCEL_OPTION.
Has anyone else noticed this behavior? Does anyone else find this confusing?
Is there a simple fix for the behavior in which the button text is outlined
on the button that is not the currently selected button? Is this a known
bug?
Thanks,
Steve
|