< prev index next >
test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.java
Print this page
@@ -21,27 +21,21 @@
* questions.
*/
/*
test
- @bug 4118621
- @summary tests that selected text isn't scrolled when there is enough room.
- @author prs: area=TextField
+ @bug 4118621 8149636
+ @summary Test the selection scrolling in TextField.
@run applet/manual=yesno ScrollSelectionTest.html
*/
-/**
- * ScrollSelectionTest.java
- *
- * summary: tests that selected text isn't scrolled when there is enough room.
- */
-
import java.applet.Applet;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.TextField;
import java.awt.TextArea;
+import java.awt.FlowLayout;
public class ScrollSelectionTest extends Applet
{
Frame frame = new Frame("ScrollSelectionTest frame");
@@ -49,31 +43,46 @@
public void init()
{
tf.setText("abcdefghijklmnopqrstuvwxyz");
frame.add(tf);
+ frame.setLayout(new FlowLayout());
tf.select(0, 20);
String[] instructions = {
- "INSTRUCTIONS:",
+ "INSTRUCTIONS: There are 3 Tests",
+ "Test1: Text visibility with Scroll ",
"This is a test for a win32 specific problem",
"If you see all the letters from 'a' to 'z' and",
"letters from 'a' to 't' are selected then test passes.",
- "You may have to activate the frame to see the selection"
- + " highlighted (e.g. by clicking on frame's title)."
+ "You may have to activate the frame to see the selection",
+ "highlighted (e.g. by clicking on frame's title).",
+ ".",
+ "Test2: Flicker with selection scroll",
+ "Mouse press on te TextField text",
+ "Move mouse towards left or right with selecting text",
+ "Move mouse away outside the bounds of TextField",
+ "No flicker should be observed.",
+ ".",
+ "Test3: Over scroll on right",
+ "Mouse press on te TextField text",
+ "Move mouse towards Right",
+ "Move mouse away outside the bounds of TextField",
+ "Observe TextField text does not get scrolled towards left",
+ "as there is no need to scroll",
};
Sysout.createDialogWithInstructions( instructions );
}// init()
public void start ()
{
- setSize (300,300);
+ setSize (300, 500);
setVisible(true);
frame.setVisible(true);
- frame.setBounds (400, 0, 300, 300);
+ frame.setBounds (400, 0, 400, 300);
}// start()
}// class ScrollSelectionTest
< prev index next >