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

scrolling problem in JTextField

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.2.0
    • client-libs
    • 2d
    • generic
    • solaris_2.5

      JTextField doesn't scroll properly (text get messed up) while RIGHT arrow key is pressed at the end of JTextField.

      To reproduce the problem:
      1) Compile and run the following test on current promoted build jdk1.2 Z
      2) press RIGHT arrow key at the end of JTextField2 which is fixed length of 15 and holds 30 chars
      3) result: the textfield doesn't scroll.

      TextTest.java
      ==============
      import java.awt.swing.*;

      public class TextTest {
        public static void main (String args[]) {
          JFrame frame = new JFrame("Text Editor");
      JPanel textfields = new JPanel();
      textfields.setLayout(new BoxLayout(textfields, BoxLayout.Y_AXIS));
      JTextField tf1 = new JTextField("aaaaabbbbbccccc");
      JTextField tf2 = new JTextField("aaaaabbbbbcccccdddddeeeeeefffffggggg", 15);
      JTextField tf3 = new JTextField("aaaaabbbbbcccccdddddeeeeeefffffggggg");
      textfields.add(new JLabel("JTextField1:"));
      textfields.add(tf1);
      textfields.add(new JLabel("JTextField2:"));
      textfields.add(tf2);
      textfields.add(new JLabel("JTextField3:"));
      textfields.add(tf3);
      frame.getContentPane().add(textfields);
          frame.setSize(200, 200);
          frame.setVisible(true);
        }
      }

            jkaulorcl Jeet Kaul (Inactive)
            tsusunw Tina Su (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: