users
[Top] [All Lists]

Re: [cinjug-users] JOptionPane

To: smetter@xxxxxxxxxxxxxxxx, users@xxxxxxxxxx
Subject: Re: [cinjug-users] JOptionPane
From: Elijah Roberts <eroberts@xxxxxxxxxxxxxxxx>
Date: Wed, 11 Jun 2003 10:00:51 -0400
Delivered-to: mailing list users@cinjug.org
In-reply-to: <IGEHLHBLCHKMJICKMMPHCEECCIAA.smetter@castworksllc.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <IGEHLHBLCHKMJICKMMPHCEECCIAA.smetter@castworksllc.com>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312
I haven't checked recently to see if Sun has changed this, but I believe that what you are describing is in reality just the proper behavior for the metal look and feel. In metal hitting the enter key always activates the default button no matter which button currently has the focus. That is simply the way the metal interface functions. If you want Windows interface functionality, such as having enter activate whatever button currently has focus I think you will have to switch to the windows look and feel. I don't know of anyway off hand to change that behavior in metal.

If you are using the windows look and feel and are seeing this issue, please ignore my above message.

Elijah

Steve Metter wrote:

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






<Prev in Thread] Current Thread [Next in Thread>