-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
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);
}
}
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);
}
}
- duplicates
-
JDK-4086564 In jdk1.2Beta1, the I-bean caret , in JTextField, is located at wrong position.
-
- Closed
-