RFR: 8233177: JTextField's size is computed incorrectly when it contains Indic or Thai characters
Abhishek Kumar
abhiscxk at openjdk.org
Tue Jan 23 09:37:28 UTC 2024
On Tue, 23 Jan 2024 08:18:33 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> Existing regression test is failing because textfield height is not as per test's expectation..Seems like the indic character being tried to render is not being loaded (probably because of missing glyphs) leading to 0 preferredSpan from [BoxView](https://github.com/openjdk/jdk/blame/5a74c2a67ebcb47e51732f03c4be694bdf920469/src/java.desktop/share/classes/javax/swing/text/BoxView.java#L545-L552) which is superclass for `i18nFieldVIew`, the field view for Indic characters.
> Tried block character in the test which is now being loaded properly leading to correct height..
test/jdk/javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java line 35:
> 33: import javax.swing.JTextField;
> 34: import javax.swing.SwingUtilities;
> 35: import javax.swing.JPanel;
Plz sort imports.
test/jdk/javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java line 56:
> 54: container.setLayout(new GridLayout(2,1));
> 55:
> 56:
Blank line can be removed.
test/jdk/javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java line 71:
> 69: height2 = textField2.getHeight();
> 70: });
> 71: if( height1 < 10 || height2 < 10 ) {
Suggestion:
if ( height1 < 10 || height2 < 10 ) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17528#discussion_r1462981003
PR Review Comment: https://git.openjdk.org/jdk/pull/17528#discussion_r1462981581
PR Review Comment: https://git.openjdk.org/jdk/pull/17528#discussion_r1462982046
More information about the client-libs-dev
mailing list