/* @test @bug 6431076 @summary Mouse cursor must remain DEFAULT over scrollbar when text is typed @author Andrei Dmitriev: area=TextArea @run main/manual Test1 */ import java.awt.*; import java.awt.event.*; public class Test1 { private static void init() { Frame f = new Frame("Test1 for cursor"); final int dim = 100; String line = ""; for( int i=0; i 0 ) { //if longer than max then chop off first max chars to print if( remainingStr.length() >= maxStringLength ) { //Try to chop on a word boundary int posOfSpace = remainingStr. lastIndexOf( ' ', maxStringLength - 1 ); if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; printStr = remainingStr.substring( 0, posOfSpace + 1 ); remainingStr = remainingStr.substring( posOfSpace + 1 ); } //else just print else { printStr = remainingStr; remainingStr = ""; } instructionsText.append( printStr + "\n" ); }// while }// for }//printInstructions() //DO NOT call this directly, go through Sysout public void displayMessage( String messageIn ) { messageText.append( messageIn + "\n" ); System.out.println(messageIn); } //catch presses of the passed and failed buttons. //simply call the standard pass() or fail() static methods of //ManualMainTest public void actionPerformed( ActionEvent e ) { if( e.getActionCommand() == "pass" ) { Test1.pass(); } else { Test1.fail(); } } }// TestDialog class