--- /dev/null 2014-07-28 16:11:16.120781410 +0400 +++ new/test/java/awt/reliability/TaskFrame.java 2014-07-28 16:22:03.540769555 +0400 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.*; +import java.awt.Label; + +/* + * @test + * @summary Create and dispose the Frame + * @author Aruna Samji + * @library ../../../lib/testlibrary + * @build ExtendedRobot + * @run main TaskFrame + */ + +public class TaskFrame extends Task { + + public static void main (String[] args) throws Exception { + new TaskFrame(new GUIComponent(), new ExtendedRobot()).runTask(); + } + + public TaskFrame(GUIComponent gui, ExtendedRobot robot) { + super(gui, robot); + } + + public void task() throws Exception { + Frame[] frame = new Frame[1]; + + for (int i = 0; i < 10; i++) { + frame[0] = new Frame("FrameTest"); + frame[0].setBackground(Color.blue); + frame[0].setSize(600, 270); + + Panel panel = new Panel(); + + Container container = new Container(); + container.setLayout(new FlowLayout()); + + Button button = new Button("Button"); + Canvas canvas = new Canvas(); + Checkbox checkbox = new Checkbox("CheckBox"); + Choice choice = new Choice(); + choice.add("Choice 1"); + choice.add("Choice 2"); + choice.add("Choice 3"); + choice.add("Choice 4"); + + Label label = new Label("Label"); + List list = new List(2); + list.add("list 1"); + list.add("list 2"); + list.add("list 3"); + Scrollbar scrollbar = new Scrollbar(); + + TextArea textarea = new TextArea("TextArea", 3, 10); + TextField textfield = new TextField("TextField"); + + container.add(button); + container.add(canvas); + container.add(checkbox); + container.add(choice); + container.add(label); + container.add(list); + container.add(scrollbar); + container.add(textarea); + container.add(textfield); + + panel.add(container); + frame[0].add(panel); + + frame[0].setVisible(true); + robot.waitForIdle(1000); + frame[0].dispose(); + robot.waitForIdle(1000); + } + } +}