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

ALT-O (OK) Keyboard accelerator in JFileChooser not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.3.1
    • client-libs
    • None
    • beta
    • sparc
    • solaris_7

      The "OK" button in the JFileChooser does not resond to keyboard accelerator key "ALT+O". The "Update" and "Cancel" buttons react to "ALT+U" and "ALT+C", respectively. Java 1.3.1

      Test case:

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class JFCTest extends JFrame {

              public JFCTest() {
                      JButton j = new JButton("Open");
                      this.getContentPane().add(j);
                      j.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent ae) {
                                      openDialog();
                              }
                      });
              }

              private void openDialog() {
                  JFileChooser jfc = new JFileChooser();
                  jfc.showOpenDialog(this);
              }
              
              public static void main(String args[]) {
                      try {
                          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                      } catch (Exception ex) {}
                      
                      JFCTest j = new JFCTest();
                      j.setSize(100,100);
                      j.setVisible(true);
              }
      }

            leifs Leif Samuelsson (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: