diff --git a/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java b/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java index fae1052a14422808554490e0d0180dc2b0d4a394..3f3b5824aa31e17dbf0694be53a8acd1724eaa74 100644 --- a/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java +++ b/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,32 +28,27 @@ @author Semyon Sadetsky */ -import javax.swing.*; +import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.text.BadLocationException; -import java.lang.Override; -import java.lang.Runnable; public class I18NViewNoWrapMinSpan { public static void main(String[] args) throws Exception { - SwingUtilities.invokeAndWait(new Runnable() { - @Override - public void run() { - try { - JTextField textField = new JTextField(15); - textField.setText("ม12345"); - float noSpaceMin = textField.getUI().getRootView(textField) - .getMinimumSpan(0); - textField.getDocument().insertString(3, " ", null); - if (noSpaceMin > textField.getUI().getRootView(textField) - .getMinimumSpan(0)) { - throw new RuntimeException( - "Minimum span is calculated for wrapped text"); - } - } catch (BadLocationException e) { - throw new RuntimeException(e); + SwingUtilities.invokeAndWait(() -> { + try { + JTextField textField = new JTextField(15); + textField.setText("\u0E2112345"); + float noSpaceMin = textField.getUI().getRootView(textField) + .getMinimumSpan(0); + textField.getDocument().insertString(3, " ", null); + if (noSpaceMin > textField.getUI().getRootView(textField) + .getMinimumSpan(0)) { + throw new RuntimeException( + "Minimum span is calculated for wrapped text"); } + } catch (BadLocationException e) { + throw new RuntimeException(e); } }); System.out.println("ok");