The behavior is as expected, I believe. If you tab to the "No" button and
hit the spacebar, does that perform the desired behavior? Hitting the
"Enter" key is supposed to be equivalent to hitting the "default" button,
which is the "Yes" button in your case (that's why it's still highlighted
black).
----- Original Message -----
From: "Steve Metter" <smetter@xxxxxxxxxxxxxxxx>
To: <users@xxxxxxxxxx>
Sent: Wednesday, June 11, 2003 9:38 AM
Subject: [cinjug-users] JOptionPane
> 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
>
>
>
>
|