Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
FULL PRODUCT VERSION : java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b18) Java HotSpot(TM) Client VM (build 25.25-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : ver : Window 7 Pro, 64bit, A DESCRIPTION OF THE PROBLEM : When Input too long Thailand characters(Must Include space) in JTextField and exceed its display size, we found the cursor's behavior is odd while moving the cursor. The cursor will not locate at between two Thai character, but in the middle of one single Thai character. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Create a simple JTextField 2. Input long Thai language wording (*Must With space in it) Exceed JTextField's display size Thai: ��������������������������������������������������������������������� ������������������������������������������������������������ ��������������������������������������������� ������������������������������������������������������������������������������ 3. Move the cursor to the end of JTextField using keyboard "->" 4. Move cursor back using keyboard "<-" 5. Then I found that, the cursor will locate at middle of one Thai character, and the characters behind the cursor will disappear. 6. At this time, if we clear all Thai characters, and input Chinese, then try steps 3 and 4, there will be similar issue. * But if we re-compile and run the application again, Just input longer Chinese , it has no this issue. Seems something wrong with the Thai input. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Whenever input longer Thai character and move the cursor, the display and behavior is right. ACTUAL - the cursor will locate at middle of one Thai character, and the characters behind the cursor will disappear. ERROR MESSAGES/STACK TRACES THAT OCCUR : No any error REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class TestTexts extends JFrame{ private JLabel label = new JLabel("Status"); private JTextField textField; private JPasswordField pwdField; private JTextArea textArea; private JFormattedTextField fField; public TestTexts() { super("Test Texts"); this.pack(); setDefaultCloseOperation(EXIT_ON_CLOSE); getContentPane().setLayout(new java.awt.FlowLayout()); textField = new JTextField(15); getContentPane().add(textField); setSize(200, 200); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new TestTexts().show(); } }); } } ---------- END SOURCE ----------
|