jdk/test/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java
author goetz
Tue, 14 Jun 2016 10:44:59 +0200
changeset 39056 d99e63b6d962
parent 5506 202f599c92aa
permissions -rw-r--r--
8159690: [TESTBUG] Mark headful tests with @key headful. Reviewed-by: simonis, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 5506
diff changeset
     2
 * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
  @test
39056
d99e63b6d962 8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents: 5506
diff changeset
    26
  @key headful
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
  @bug       6492970
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
  @summary   Tests that showing a toplvel in a not foreground Java process activates it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
  @library   ../../regtesthelpers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
  @build     Util
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
  @author    Anton Tarasov: area=awt-focus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
  @run       main ShowFrameCheckForegroundTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.applet.Applet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.util.concurrent.atomic.AtomicBoolean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.lang.reflect.InvocationTargetException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import test.java.awt.regtesthelpers.Util;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
public class ShowFrameCheckForegroundTest extends Applet {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    Robot robot;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    Frame nofocusFrame = new Frame("Non-focusable");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    Frame frame = new Frame("Frame");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    Dialog dialog1 = new Dialog(nofocusFrame, "Owned Dialog", false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    Dialog dialog2 = new Dialog((Frame)null, "Owned Dialog", false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    Window testToplevel = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    Button testButton = new Button("button");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    Button showButton = new Button("show");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    Runnable action = new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        public void run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            robot.keyPress(KeyEvent.VK_SPACE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
            robot.delay(50);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            robot.keyRelease(KeyEvent.VK_SPACE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static void main(String[] args) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        ShowFrameCheckForegroundTest app = new ShowFrameCheckForegroundTest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        app.init();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        app.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public void init() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        robot = Util.createRobot();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public void start() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        showButton.addActionListener(new ActionListener() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            public void actionPerformed(ActionEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                testToplevel.setVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        nofocusFrame.add(showButton);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        nofocusFrame.pack();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        nofocusFrame.setFocusableWindowState(false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        nofocusFrame.setVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        Util.waitForIdle(robot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        robot.delay(3000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        // 1. Show the toplvel without clicking into the non-focusable frame.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        test(frame, 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        test(dialog1, 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        test(dialog2, 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        // 2. Showing the toplvel via clicking into the non-focusable frame.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        test(frame, 2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        test(dialog1, 2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        test(dialog2, 2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        System.out.println("Test passed.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    private void test(Window toplevel, int stage) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        toplevel.add(testButton);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        toplevel.pack();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        toplevel.setLocation(200, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        switch (stage) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            case 1:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                toplevel.setVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            case 2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                testToplevel = toplevel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                Util.clickOnComp(showButton, robot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        Util.waitForIdle(robot);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        if (!Util.trackActionPerformed(testButton, action, 2000, false)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
            throw new TestFailedException("Stage " + stage + ". The toplevel " + toplevel + " wasn't made foreground on showing");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        System.out.println("Stage " + stage + ". Toplevel " + toplevel + " - passed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        toplevel.dispose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
class TestFailedException extends RuntimeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    TestFailedException(String msg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        super("Test failed: " + msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
/****************************************************
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 * Standard Test Machinery
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 * DO NOT modify anything below -- it's a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 * chunk of code whose purpose is to make user
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 * interaction uniform, and thereby make it simpler
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 * to read and understand someone else's test.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 ****************************************************/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * This is part of the standard test machinery.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * It creates a dialog (with the instructions), and is the interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * for sending text messages to the user.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 * To print the instructions, send an array of strings to Sysout.createDialog
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
 * WithInstructions method.  Put one line of instructions per array entry.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
 * To display a message for the tester to see, simply call Sysout.println
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 * with the string to be displayed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
 * This mimics System.out.println but works within the test harness as well
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * as standalone.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
class Sysout {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    static TestDialog dialog;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    public static void createDialogWithInstructions( String[] instructions ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
        dialog = new TestDialog( new Frame(), "Instructions" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        dialog.printInstructions( instructions );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        dialog.setVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        println( "Any messages for the tester will display here." );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public static void createDialog( ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        dialog = new TestDialog( new Frame(), "Instructions" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        String[] defInstr = { "Instructions will appear here. ", "" } ;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        dialog.printInstructions( defInstr );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        dialog.setVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        println( "Any messages for the tester will display here." );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    public static void printInstructions( String[] instructions ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        dialog.printInstructions( instructions );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    public static void println( String messageIn ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        dialog.displayMessage( messageIn );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
}// Sysout  class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
 * This is part of the standard test machinery.  It provides a place for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 * test instructions to be displayed, and a place for interactive messages
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 * to the user to be displayed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
 * To have the test instructions displayed, see Sysout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
 * To have a message to the user be displayed, see Sysout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
 * Do not call anything in this dialog directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
class TestDialog extends Dialog {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    TextArea instructionsText;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    TextArea messageText;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    int maxStringLength = 80;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    //DO NOT call this directly, go through Sysout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    public TestDialog( Frame frame, String name ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        super( frame, name );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        int scrollBoth = TextArea.SCROLLBARS_BOTH;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        add( "North", instructionsText );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        add("Center", messageText);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        pack();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        setVisible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    }// TestDialog()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    //DO NOT call this directly, go through Sysout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    public void printInstructions( String[] instructions ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        //Clear out any current instructions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        instructionsText.setText( "" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        //Go down array of instruction strings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        String printStr, remainingStr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        for( int i=0; i < instructions.length; i++ ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            //chop up each into pieces maxSringLength long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            remainingStr = instructions[ i ];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            while( remainingStr.length() > 0 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                //if longer than max then chop off first max chars to print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                if( remainingStr.length() >= maxStringLength ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    //Try to chop on a word boundary
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                    int posOfSpace = remainingStr.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                            lastIndexOf( ' ', maxStringLength - 1 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                    remainingStr = remainingStr.substring( posOfSpace + 1 );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                //else just print
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                    printStr = remainingStr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                    remainingStr = "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                instructionsText.append( printStr + "\n" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
            }// while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        }// for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    }//printInstructions()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    //DO NOT call this directly, go through Sysout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public void displayMessage( String messageIn ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        messageText.append( messageIn + "\n" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        System.out.println(messageIn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
}// TestDialog  class