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

JFileChooser does not set mnemonic on ApproveButton

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • beta
    • x86
    • windows_nt



      Name: rlT66838 Date: 09/16/99


      The setApproveButtonMnemonic is not working correctly. It will always
      use 'o' as the mnemonic even though the getApproveButtonMnemonic reports
      using the B. Also shouldn't the Approve Button have the default focus?

      Here is the source code to reproduce this.

      import java.lang.*;
      import javax.swing.*;

      public class problem extends JDialog
      {
      public problem()
      {
      super();

      JFileChooser chooser = new JFileChooser();
      chooser.setApproveButtonText("Problem");
      chooser.setApproveButtonMnemonic('b');

      System.out.println((char) chooser.getApproveButtonMnemonic());

      getContentPane().add(chooser);

      setSize(500, 400);
      setVisible(true);
      }

      public static void main(String Args[])
      {
      problem ThisDialog = new problem();
      }
      }

      java version "1.2.2"
      Classic VM (build JDK-1.2.2-U, native threads, symcjit)

      I can also reproduce it using
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)
      (Review ID: 95295)
      ======================================================================

            leifs Leif Samuelsson (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: