test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java
changeset 54231 e4813eded7cb
parent 50834 9cf279436b9d
equal deleted inserted replaced
54230:d9d9655bb077 54231:e4813eded7cb
    24 /*
    24 /*
    25   @test
    25   @test
    26   @key headful
    26   @key headful
    27   @bug       6187066
    27   @bug       6187066
    28   @summary   Tests the Window.autoRequestFocus property for the Window.toFront() method.
    28   @summary   Tests the Window.autoRequestFocus property for the Window.toFront() method.
    29   @author    anton.tarasov: area=awt.focus
       
    30   @library /java/awt/patchlib     ../../regtesthelpers
    29   @library /java/awt/patchlib     ../../regtesthelpers
    31   @build java.desktop/java.awt.Helper
    30   @build java.desktop/java.awt.Helper
    32   @build      Util
    31   @build      Util
    33   @run       main AutoRequestFocusToFrontTest
    32   @run       main AutoRequestFocusToFrontTest
    34 */
    33 */
    35 
    34 
    36 import java.awt.*;
    35 import java.awt.*;
    37 import java.awt.event.*;
       
    38 import java.applet.Applet;
       
    39 import java.util.concurrent.atomic.AtomicBoolean;
       
    40 import java.lang.reflect.InvocationTargetException;
       
    41 import test.java.awt.regtesthelpers.Util;
    36 import test.java.awt.regtesthelpers.Util;
    42 
    37 
    43 public class AutoRequestFocusToFrontTest extends Applet {
    38 public class AutoRequestFocusToFrontTest {
    44     static boolean haveDelays;
    39     static boolean haveDelays;
    45 
    40 
    46     static Frame auxFrame;
    41     static Frame auxFrame;
    47     static Frame frame;
    42     static Frame frame;
    48     static Button frameButton;
    43     static Button frameButton;
    74         app.init();
    69         app.init();
    75         app.start();
    70         app.start();
    76     }
    71     }
    77 
    72 
    78     public void init() {
    73     public void init() {
    79         // Create instructions for the user here, as well as set up
       
    80         // the environment -- set the layout manager, add buttons,
       
    81         // etc.
       
    82         this.setLayout (new BorderLayout ());
       
    83         toolkitClassName = Toolkit.getDefaultToolkit().getClass().getName();
    74         toolkitClassName = Toolkit.getDefaultToolkit().getClass().getName();
    84     }
    75     }
    85 
    76 
    86     static void recreateGUI() {
    77     static void recreateGUI() {
    87         if (auxFrame != null) {
    78         if (auxFrame != null) {