From 681764bad08ef527b3ff24e3de3b35ad74a2d728 Mon Sep 17 00:00:00 2001 From: Dmitry Markov Date: Fri, 28 Jun 2013 18:32:20 +0400 Subject: [PATCH] 8016534: javax/swing/text/View/8014863/bug8014863.java failed Reviewed-by: alexp, alexsch --- jdk/test/javax/swing/text/View/8014863/bug8014863.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/test/javax/swing/text/View/8014863/bug8014863.java b/jdk/test/javax/swing/text/View/8014863/bug8014863.java index 3ceebd676f2..ba78b4bbbbb 100644 --- a/jdk/test/javax/swing/text/View/8014863/bug8014863.java +++ b/jdk/test/javax/swing/text/View/8014863/bug8014863.java @@ -136,9 +136,12 @@ public class bug8014863 { "qqqq pp qqqq pp qqqq pp qqqq pp" + " qqqq pp qqqq pp qqqq pp qqqq

"); editorPane.setCaretPosition(1); - + // An actual font size depends on OS and might be differnet on various OSs. + // It is necessary to calculate the width to meet the expected number of lines. + int width = SwingUtilities.computeStringWidth(editorPane.getFontMetrics(editorPane.getFont()), + "qqqq pp qqqq pp qqqq pp qqqqqqqq"); frame.add(editorPane); - frame.setSize(200, 200); + frame.setSize(width, 200); frame.setVisible(true); } });