/* @test @bug 4103095 @summary Test for getBounds() after a Frame resize. @author andrei.dmitriev : area=awt.toplevel @run main/manual GetBoundsResizeTest */ import java.applet.Applet; import java.lang.*; import java.awt.*; import java.awt.event.*; class Globals { static boolean testPassed=false; static Thread mainThread=null; } public class GetBoundsResizeTest extends Applet { public static void main(String args[]) throws Exception { GetBoundsResizeTest app = new GetBoundsResizeTest(); app.start(); Globals.mainThread = Thread.currentThread(); try { Thread.sleep(300000); } catch (InterruptedException e) { if (!Globals.testPassed) throw new Exception("GetBoundsResizeTest failed."); } } public void start() { String[] message = { "Resize the window using the upper left corner.", "Press the button to print the result of getBounds() to the terminal.", "If getBounds() prints the correct values for the window", "then click Pass, else click Fail." }; new TestDialog(new Frame(), "GetBoundsResizeTest", message).start(); new GetBoundsResizeTester("GetBoundsResizeTester").start(); } } //////////////////////////////////////////////////////////////////////// // Test Dialog //////////////////////////////////////////////////////////////////////// class TestDialog extends Dialog implements ActionListener { static TextArea output; Button passButton; Button failButton; String name; public TestDialog(Frame frame, String name, String[] message) { super(frame, name + " Pass/Fail Dialog"); this.name = name; int maxStringLength = 0; for (int i=0; i