< prev index next >

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

Print this page

        

*** 20,55 **** * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! test @bug 5004032 @summary GridBagConstraints.ipad(x|y) defined in a new way ! @author dav@sparc.spb.su area= ! @run applet GridBagLayoutIpadXYTest.html */ - 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(); frame.setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); Insets fieldInsets = new Insets(0,5,5,0); gc.anchor = gc.NORTH; --- 20,45 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! @test ! @key headful @bug 5004032 @summary GridBagConstraints.ipad(x|y) defined in a new way ! @run main GridBagLayoutIpadXYTest */ import java.awt.*; ! 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,71 **** --- 52,62 ---- 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,91 **** System.out.println(" Fields's size is "+jtf.getSize()); throw new RuntimeException("Test Failed. TextField has incorrect width. "); } System.out.println("Test Passed."); ! ! }// start() } --- 75,81 ---- System.out.println(" Fields's size is "+jtf.getSize()); throw new RuntimeException("Test Failed. TextField has incorrect width. "); } System.out.println("Test Passed."); ! } }
< prev index next >