Bug #5012


highlighted OK button in 'Annimate at runtime ...' menu item does not work.

Added by jianwu jianwu over 13 years ago. Updated over 13 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


This bug is reported by a scientist user.

Under tools select 'Annimate at runtime...', it will ask you to for the 'Time to hold the highlight'. Enter a number. The OK button will be highlit, but you have to click on it or use 'Tab' firstly to select, even though it is highlit as opposed to simply hitting the 'Enter' (<cr>) button.

Haven't found other menu items having the same behavior.

In File --> Save As, you can just type file name and use 'Enter' to finish saving, no 'Tab' or mouse needed. I also tried the similar situations in other software, they allows users to just hit 'Enter' after enter number or string.

Files (427 Bytes) Christopher Brooks, 05/15/2010 10:59 AM (1.13 KB) Christopher Brooks, 05/15/2010 11:00 AM
JFileChooserComponentDialogTest.class (483 Bytes) JFileChooserComponentDialogTest.class Christopher Brooks, 05/15/2010 11:11 AM
Actions #1

Updated by Christopher Brooks over 13 years ago

Attached is a test that uses JOptionPane that closes when the user hits "Return".

Actions #4

Updated by Christopher Brooks over 13 years ago

Just to be clear, the problem here is that when a dialog comes up and the
user immediately hits the "Return/Enter" key, then the expected behavior
is that the highlighted button (usually "OK") will be activated and
the window will close. This is not the case with a bunch of Ptolemy dialogs,
the user must move the focus (either with the mouse or by tabbing)
to the buttons and then hit "Return/Enter"

I think the problem is with ptolemy.gui.ComponentDialog.
I attached three test cases.
The first one:
uses JOptionPane. It has a text entry field and when the user
hits return, the window closes.

The second one uses ptolemy.gui.Query and ptolemy.gui.ComponentDialog
does not close when the user hits return.

However, in the second attachment, if I comment out the Java code that
adds the line entry then code works as expected - hitting return closes
the dialog.

I suspect the problem has to do with focus and the focus of the internal
ptolemy.gui.Query not being passed up to the container ComponentDialog.

In Ptolemy Vergil, File | Save As uses the JFileChooser in ptolemy.gui.Top.
ComponentDialog is not used.

The third attachment:
embeds a JFileChooser into a ComponentDialog. This test does work, hitting
return closes the window. I think the issue is that there is not a
entry widget in the JFileChooser.

It could be that not having the focus be on the buttons is the right thing
in the case of the the second attachment. For example, if there was a
TextArea to be filled in and the focus was in the TextArea and the user
typed a return, then I'd expect that the TextArea would get the return not
the button. To try this, add
query.addTextArea("textArea", "An area", "Elvis");
to the second attachment.

Actions #5

Updated by Redmine Admin over 10 years ago

Original Bugzilla ID was 5012


Also available in: Atom PDF