From 7842ee394548ba1c1b70f9cdeb3c4f00271340fb Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Mon, 23 Dec 2013 18:54:50 +0400 Subject: [PATCH] 8030953: SelectionVisible test should test multiline selection in case of TextArea Reviewed-by: pchelko, azvegint --- .../SelectionVisible/SelectionVisible.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java b/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java index c34f75f60d7..08698d815c1 100644 --- a/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java +++ b/jdk/test/java/awt/TextArea/SelectionVisible/SelectionVisible.java @@ -31,32 +31,32 @@ import java.awt.TextArea; public final class SelectionVisible extends Applet { - TextArea tf; + private TextArea ta; @Override public void init() { - tf = new TextArea(3, 20); - tf.setText("0123456789"); - tf.select(0, 6); + ta = new TextArea(4, 20); + ta.setText("01234\n56789"); + ta.select(3, 9); - final TextArea ta = new TextArea("INSTRUCTIONS:\n" - + "The text 012345 should be selected in the TextArea.\n" + final TextArea instruction = new TextArea("INSTRUCTIONS:\n" + + "The text 34567 should be selected in the TextArea.\n" + "If this is what you observe, then the test passes.\n" + "Otherwise, the test fails.", 40, 5, TextArea.SCROLLBARS_NONE); - ta.setEditable(false); - ta.setPreferredSize(new Dimension(300, 70)); + instruction.setEditable(false); + instruction.setPreferredSize(new Dimension(300, 70)); final Panel panel = new Panel(); panel.setLayout(new FlowLayout()); - panel.add(tf); + panel.add(ta); setLayout(new BorderLayout()); - add(ta, BorderLayout.CENTER); + add(instruction, BorderLayout.CENTER); add(panel, BorderLayout.PAGE_END); } @Override public void start() { setVisible(true); - tf.requestFocus(); + ta.requestFocus(); } }