< prev index next >

test/jdk/java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java

Print this page

        

@@ -24,24 +24,22 @@
 /*
   @test
   @key headful
   @bug       6496958
   @summary   Tests that breaking the proccess of clearing LW requests doesn't break focus.
-  @author    anton.tarasov@...: area=awt-focus
   @library    ../../regtesthelpers
   @build      Util
   @run       main ClearLwQueueBreakTest
 */
 
 import java.awt.*;
 import javax.swing.*;
 import java.awt.event.*;
-import java.applet.Applet;
 import test.java.awt.regtesthelpers.Util;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-public class ClearLwQueueBreakTest extends Applet {
+public class ClearLwQueueBreakTest {
     JFrame f1 = new JFrame("frame");
     JFrame f2 = new JFrame("frame");
     JButton b = new JButton("button");
     JTextField tf1 = new JTextField("     ");
     JTextField tf2 = new JTextField("     ");

@@ -58,15 +56,10 @@
         app.start();
     }
 
     public void init() {
         robot = Util.createRobot();
-
-        // Create instructions for the user here, as well as set up
-        // the environment -- set the layout manager, add buttons,
-        // etc.
-        this.setLayout (new BorderLayout ());
     }
 
     public void start() {
         b.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent e) {

@@ -116,10 +109,11 @@
         f1.add(tf1);
         f1.add(tf2);
         f1.add(tf3);
         f1.setLayout(new FlowLayout());
         f1.pack();
+        f1.setLocationRelativeTo(null);
         f1.setVisible(true);
         Util.waitForIdle(robot);
 
         /*
          * Break the sequence of LW requests in the middle.
< prev index next >