< prev index next >

test/jdk/java/awt/GridBagLayout/GridBagLayoutIpadXYTest/GridBagLayoutIpadXYTest.java

Print this page

        

@@ -20,36 +20,26 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
 /*
-  test
+  @test
+  @key headful
   @bug 5004032
   @summary GridBagConstraints.ipad(x|y) defined in a new way
-  @author dav@sparc.spb.su area=
-  @run applet GridBagLayoutIpadXYTest.html
+  @run main GridBagLayoutIpadXYTest
 */
 
-import java.applet.Applet;
 import java.awt.*;
 
-public class GridBagLayoutIpadXYTest extends Applet
-{
-    Frame frame = new Frame();
-    TextField jtf = null;
-    final int customIpadx = 300;
-    final int customIpady = 40;
-
-    public void init()
-    {
-        this.setLayout (new BorderLayout ());
-
-    }//End  init()
-
-    public void start ()
-    {
-        validate();
+public class GridBagLayoutIpadXYTest {
+    static Frame frame = new Frame();
+    static TextField jtf = null;
+    static final int customIpadx = 300;
+    static final int customIpady = 40;
+
+    public static void main(final String[] args) {
         frame.setLayout(new GridBagLayout());
         GridBagConstraints gc = new GridBagConstraints();
         Insets fieldInsets = new Insets(0,5,5,0);
 
         gc.anchor = gc.NORTH;

@@ -62,10 +52,11 @@
         gc.insets = fieldInsets;
         jtf = new TextField();
         frame.add(jtf, gc);
 
         frame.pack();
+        frame.setLocationRelativeTo(null);
         frame.setVisible(true);
 
         Robot robot;
         try {
             robot = new Robot();

@@ -84,8 +75,7 @@
             System.out.println(" Fields's size is "+jtf.getSize());
 
             throw new RuntimeException("Test Failed. TextField has incorrect width. ");
         }
         System.out.println("Test Passed.");
-
-    }// start()
+    }
 }
< prev index next >