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

JTextField not accepting Tilde

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • client-libs

      FULL PRODUCT VERSION :
      Version 5.0 / 1.5.0

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP and Windows 2000

      A DESCRIPTION OF THE PROBLEM :
      It ain't possible to type a tilde '~' in the JTextField below

      The only way of doing it is by typing it this way

      1. Hit Shift and ~ keys
      2. Hit Alt Gr + ^ keys

      I'm using a danish keyboard, tried switching to english keyboard, but that didn't solve it

      I haven't testet in early versions of SUNs Java, but it works perfect
      in MS Java

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Try typing a tilde '~' in the text field

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected to see a tilde
      ACTUAL -
      Nothing happend

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Here is a testcase

      public class TestTilde extends javax.swing.JFrame {
          public TestTilde() {
              initComponents();
              setSize(400,300);
              jTextArea1.setText("It ain't possible to type a tilde '~' in the JTextField below"
                                  + "\n\nThe only way of doing it is by typing it this way\n\n"
                                  + "\t1. Hit Shift and ~ keys\n\t2. Hit Alt Gr + ^ keys");
          }
          
          private void initComponents() {
              jTextArea1 = new javax.swing.JTextArea();
              jTextField1 = new javax.swing.JTextField();

              getContentPane().setLayout(new java.awt.GridLayout(2, 1));

              setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
              jTextArea1.setBackground(new java.awt.Color(255, 255, 153));
              jTextArea1.setEditable(false);
              jTextArea1.setDisabledTextColor(new java.awt.Color(0, 0, 0));
              jTextArea1.setEnabled(false);
              getContentPane().add(jTextArea1);

              jTextField1.setColumns(10);
              getContentPane().add(jTextField1);

              pack();
          }

          public static void main(String args[]) {
              java.awt.EventQueue.invokeLater(new Runnable() {
                  public void run() {
                      new TestTilde().setVisible(true);
                  }
              });
          }

          private javax.swing.JTextArea jTextArea1;
          private javax.swing.JTextField jTextField1;
      }

      ---------- END SOURCE ----------

            peterz Peter Zhelezniakov
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: