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

setMnemonic not consuming key...

XMLWordPrintable

    • generic, x86
    • generic, windows_nt



      Name: dbT83986 Date: 01/04/99


      I don't know if this bug existed before, but my application echoes the Mnemonic into my JTextField.

      Here is the JDK1.2 code:
      ------------------------
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class SimpleExample extends JPanel
      {
          static JFrame frame;

          public SimpleExample()
          {
              JButton _testButton = new JButton( "Test" );
              _testButton.setMnemonic('T');

              add(_testButton);
              add(new JTextField(10));
          }

          public static void main(String s[])
          {
              SimpleExample panel = new SimpleExample();

              frame = new JFrame("SimpleExample");
              frame.addWindowListener(new WindowAdapter()
              {
                  public void windowClosing(WindowEvent e)
                              {System.exit(0);}
              });

              frame.getContentPane().add("Center", panel);
              frame.pack();
              frame.setVisible(true);
          }
      }
      --------------------
      It can be reproduced by setting focus on JTextField,
      then press <ALT-T>, it echoes 't' in the JTextField.

      ***
      (Review ID: 49034)
      ======================================================================

            ehawkessunw Eric Hawkes (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: