A DESCRIPTION OF THE PROBLEM :
When the text entered into a JTextField exceeds the JTextField bounds, i.e. not all the text is visible, and the text contains both Hebrew and English text, there is character overlap. The Hebrew letters are painted over the English ones. The longer the text, the more overlap there is.
REGRESSION : Last worked in version 8u172
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a stand-alone java Swing application that contains a JTextField. Make the JTextField large enough to display around 7 characters. Set the component orientation of the JTextField to RIGHT-TO-LEFT. Run the application. Start to enter English text into the JTextField. After entering three English characters, switch to Hebrew (or Arabic or any other right-to-left language) and start entering characters in that language. When the text length exceeds the width of the JTextField, the first Hebrew characters begin to overlap the last English characters.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be no overlap of the characters.
ACTUAL -
The JTextField contents look as if a Hebrew letter was written over the top of an English letter.
---------- BEGIN SOURCE ----------
public class Sscce {
private static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
javax.swing.JFrame frame = new javax.swing.JFrame();
frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
javax.swing.JTextField tf = new javax.swing.JTextField(7);
tf.setComponentOrientation(java.awt.ComponentOrientation.RIGHT_TO_LEFT);
javax.swing.JPanel p = new javax.swing.JPanel();
p.add(tf);
frame.add(p);
frame.pack();
frame.setVisible(true);
});
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Using a JTextArea wrapped in a JScrollPane where the number of rows in the JTextArea is one and the scrollbars of the JScrollPane are never shown.
FREQUENCY : always