Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4859578

Enter key does not work for JFileChooser buttons

XMLWordPrintable

    • x86
    • windows_nt, windows_2000



      Name: dk106046 Date: 05/07/2003

      Problem re-creatable on JDK 1.4.1_01-b01 and jdk 1.4.2-beta-b19.

      Problem Description:

      When you bring up a JFileChooser dialog and there is no file name in the file name field, when you tab to the Cancel button and press the <Enter> key nothing happens. If there is a file name in the file name field then you can press <Enter> when the Cancel button has focus and the dialog will close as expected.

      Exact steps to reproduce:

      1. Bring up a JFileChooser.
      2. Do not select a file.
      3. Tab to the cancel button.
      4. Press the <Enter> key. <- problem

      Testcase:

      import javax.swing.JFileChooser;
      import java.awt.Frame;

      class TestFileChooser
      {
          public static void main(String args[])
          {
               JFileChooser d = new JFileChooser();
               Frame f = new Frame();

               d.showOpenDialog(f);

           }
      }

      ======================================================================

            Unassigned Unassigned
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: