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

In jdk1.2Beta1, the I-bean caret , in JTextField, is located at wrong position.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.0
    • client-libs
    • 2d
    • generic, x86, sparc
    • generic, solaris_2.5, solaris_2.5.1, solaris_2.6, windows_95

      When modifying the JTextField content, the I-bean caret is located at wrong position. Therefore it screws up the JTextField content.

      This bug ONLY exists in Solaris. It is all right in NT.

      To reproduce the bug, use the following code :

      import java.awt.*;
      import java.io.*;
      import java.util.*;
      import java.awt.event.*;
      import java.awt.swing.*;

      public class TestField extends JFrame implements ActionListener
      {
        JTextField textField;
          public TestField() {
          super("Test JTextField");
          textField = new JTextField("Hello");
          textField.addActionListener(this);

          JPanel onePanel = new JPanel();
          onePanel.setLayout(new BorderLayout());
          onePanel.add(textField);

          this.getContentPane().add("Center",onePanel);

          WindowListener wl = new WindowAdapter(){
                  public void windowClosing(WindowEvent event){
                      System.exit(0);
                  }
              };
          addWindowListener(wl);
          setSize(500,100);
          setLocation(300, 300);

              show();
          }

          public void actionPerformed(ActionEvent e){

            System.out.println( textField.getText());
          }

          public static void main(String args[]){
              TestField frame = new TestField();
          }
      }


      // The end.

      patience.chu@Eng 1998-02-11 - Upgrate the test to the latest Jdk1.2

            jkaulorcl Jeet Kaul (Inactive)
            pchusunw Patience Chu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: