8213110: Remove the use of applets in automatic tests

Reviewed-by: prr
This commit is contained in:
Sergey Bylokhov 2019-02-27 18:46:55 -08:00
parent e735fe2fc4
commit b5998aadf0
141 changed files with 762 additions and 4068 deletions
test/jdk
ProblemList.txt
java/awt
Choice
Clipboard/HTMLTransferTest
Component/F10TopToplevel
ComponentOrientation
EventDispatchThread/LoopRobustness
FileDialog/FilenameFilterTest
Focus
ActualFocusedWindowTest
AppletInitialFocusTest
AutoRequestFocusTest
ChildWindowFocusTest
ClearLwQueueBreakTest
CloseDialogActivateOwnerTest
ConsumeNextKeyTypedOnModalShowTest
ContainerFocusAutoTransferTest
DeiconifiedFrameLoosesFocus
FocusEmbeddedFrameTest
FocusOwnerFrameOnClick
FocusSubRequestTest
FrameJumpingToMouse
IconifiedFrameFocusChangeTest
ModalBlockedStealsFocusTest
ModalDialogInitialFocusTest
ModalExcludedWindowClickTest
NoAutotransferToDisabledCompTest
NonFocusableBlockedOwnerTest
NonFocusableWindowTest
RequestFocusToDisabledCompTest
ResetMostRecentFocusOwnerTest
RestoreFocusOnDisabledComponentTest
ShowFrameCheckForegroundTest
ToFrontFocusTest
WindowInitialFocusTest
WindowUpdateFocusabilityTest
WrongKeyTypedConsumedTest
FontClass/CreateFont
Frame
FullScreen/SetFSWindow
GridBagLayout/GridBagLayoutIpadXYTest
KeyboardFocusmanager
List
Mouse
Multiscreen/WindowGCChangeTest
Window/HandleWindowDestroyTest
datatransfer
dnd

@ -114,7 +114,7 @@
# jdk_awt
java/awt/event/MouseEvent/MouseClickTest/MouseClickTest.html 8168389 windows-all,macosx-all
java/awt/event/MouseEvent/MouseClickTest/MouseClickTest.java 8168389 windows-all,macosx-all
java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java 8168408 windows-all,macosx-all
java/awt/Focus/FocusOwnerFrameOnClick/FocusOwnerFrameOnClick.java 8081489 generic-all
java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java 6849364 generic-all
@ -127,7 +127,7 @@ java/awt/FileDialog/8003399/bug8003399.java 8198334 windows-all
java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion.java 8060176 windows-all,macosx-all
java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all
java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html 8171510 macosx-all
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java 8171510 macosx-all
javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all
java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all
java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all
@ -139,7 +139,7 @@ java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest
java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java 8028701 macosx-all,linux-all
java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java 8159599 macosx-all
java/awt/Focus/TypeAhead/TestFocusFreeze.java 8198622 macosx-all
java/awt/Focus/ToFrontFocusTest/ToFrontFocus.html 7156130 linux-all
java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java 7156130 linux-all
java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096 macosx-all
java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 6626492 generic-all
java/awt/EventQueue/6980209/bug6980209.java 8198615 macosx-all
@ -149,7 +149,7 @@ java/awt/grab/EmbeddedFrameTest1/EmbeddedFrameTest1.java 7080150 macosx-all
java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 8198623 macosx-all
java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java 8198623 macosx-all
java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html 8198626 macosx-all
java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java 8198626 macosx-all
java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8049405 macosx-all
java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all
java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java 8159451 linux-all,windows-all,macosx-all
@ -166,7 +166,7 @@ java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all
java/awt/Toolkit/RealSync/Test.java 6849383 macosx-all
java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java 8159252 windows-all
java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java 8203047 macosx-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html 8073636 macosx-all
java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java 8073636 macosx-all
java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all,linux-all
java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all
java/awt/Focus/6378278/InputVerifierTest.java 8198616 macosx-all
@ -182,7 +182,7 @@ java/awt/event/KeyEvent/ExtendedModifiersTest/ExtendedModifiersTest.java 8129778
java/awt/event/KeyEvent/KeyMaskTest/KeyMaskTest.java 8129778 generic-all
java/awt/event/MouseEvent/MouseButtonsAndKeyMasksTest/MouseButtonsAndKeyMasksTest.java 8129778 generic-all
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.html 8194947 generic-all
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.java 8194947 generic-all
java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java 8196006 windows-all
java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java 8047218 generic-all
@ -246,11 +246,11 @@ java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8197796 ge
java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java 8196300 windows-all
java/awt/print/PrinterJob/PSQuestionMark.java 7003378 generic-all
java/awt/print/PrinterJob/GlyphPositions.java 7003378 generic-all
java/awt/Choice/PopupPosTest/PopupPosTest.html 8197811 windows-all
java/awt/Choice/PopupPosTest/PopupPosTest.java 8197811 windows-all
java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,linux-all
java/awt/Component/CreateImage/CreateImage.java 8198334 windows-all
java/awt/Component/GetScreenLocTest/GetScreenLocTest.java 4753654 generic-all
java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.html 8017454 macosx-all
java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 8017454 macosx-all
java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java 8000171 windows-all
java/awt/Frame/MiscUndecorated/RepaintTest.java 8079267 windows-all,linux-all
java/awt/Robot/ModifierRobotKey/ModifierRobotKeyTest.java 8157173 generic-all
@ -465,14 +465,14 @@ java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all
java/awt/JAWT/JAWT.sh 8197798 windows-all,linux-all
java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all
java/awt/Robot/RobotWheelTest/RobotWheelTest.java 8129827 generic-all
java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.html 8202926 linux-all
java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8202926 linux-all
java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all
java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all
java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.html 8202882 linux-all
java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java 8202882 linux-all
java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
java/awt/dnd/MissingDragExitEventTest/MissingDragExitEventTest.java 8030121 macosx-all,linux-all
java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931 macosx-all,linux-all
java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html 7124275 macosx-all
java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 7124275 macosx-all
java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java 6848810 macosx-all,linux-all
java/awt/Component/NativeInLightShow/NativeInLightShow.java 8202932 linux-all
java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java 8194751 linux-all
@ -481,7 +481,7 @@ java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.j
java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java 7107528 linux-all,macosx-all
java/awt/Mouse/MouseDragEvent/MouseDraggedTest.java 8080676 linux-all
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersInKeyEvent.java 8157147 linux-all,solaris-all,windows-all
java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.html 8148041 linux-all
java/awt/Mouse/TitleBarDoubleClick/TitleBarDoubleClick.java 8148041 linux-all
java/awt/Toolkit/DesktopProperties/rfe4758438.java 8193547 linux-all
java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163
java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all

@ -1,46 +0,0 @@
<!--
Copyright (c) 2011, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6200670
@summary MouseMoved events are triggered by Choice when mouse is moved outside the component, XToolkit
@library ../../regtesthelpers/
@author andrei.dmitriev area=choice
@build Util
@run applet PopdownGeneratesMouseEvents.html
-->
<head>
<title> </title>
</head>
<body>
<h1>PopdownGeneratesMouseEvents<br>Bug ID: 6200670 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="PopdownGeneratesMouseEvents.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2018, 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
@ -22,27 +22,32 @@
*/
/*
test
@test
@key headful
@bug 6200670
@summary MouseMoved events are triggered by Choice when mouse is moved outside the component, XToolkit
@library ../../regtesthelpers/
@author andrei.dmitriev area=choice
@build Util
@run applet PopdownGeneratesMouseEvents.html
@run main PopdownGeneratesMouseEvents
*/
import test.java.awt.regtesthelpers.Util;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class PopdownGeneratesMouseEvents extends Applet {
public class PopdownGeneratesMouseEvents extends Frame {
private volatile Robot robot;
private final Choice choice1 = new Choice();
private volatile MouseMotionHandler mmh;
public static void main(final String[] args) {
PopdownGeneratesMouseEvents app = new PopdownGeneratesMouseEvents();
app.init();
app.start();
}
public void init() {
for (int i = 1; i < 10; i++) {
choice1.add("item-0" + i);
@ -61,6 +66,7 @@ public class PopdownGeneratesMouseEvents extends Applet {
public void start() {
setSize(300, 200);
setLocationRelativeTo(null);
setVisible(true);
validate();
String toolkit = Toolkit.getDefaultToolkit().getClass().getName();

@ -1,47 +0,0 @@
<!--
Copyright (c) 2004, 2018, 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.
-->
<html>
<!--
@test
@key headful
@bug 5044150
@summary Tests that pupup doesn't popdown if no space to display under
@author ssi@sparc.spb.su
@library /test/lib
@build jdk.test.lib.Platform
@run applet PopupPosTest.html
-->
<head>
<title> PopupPosTest </title>
</head>
<body>
<h1>PopupPosTest<br>Bug ID: 5044150</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="PopupPosTest.class" WIDTH=350 HEIGHT=400></APPLET>
</body>
</html>

@ -22,25 +22,23 @@
*/
/*
test
@test
@key headful
@bug 5044150
@summary Tests that pupup doesn't popdown if no space to display under
@author andrei.dmitriev area=awt.choice
@library /test/lib
@build jdk.test.lib.Platform
@run applet PopupPosTest.html
@run main PopupPosTest
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import jdk.test.lib.Platform;
public class PopupPosTest extends Applet
{
public void start ()
{
public class PopupPosTest {
public static void main(final String[] args) {
if (Platform.isOSX()) {
// On OS X, popup isn't under the mouse
return;

@ -1,45 +0,0 @@
<!--
Copyright (c) 2015, 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.
-->
<html>
<!--
@test
@key headful
@bug 6392086 8014725
@summary Tests basic DnD functionality in an applet
@author Alexey Utkin, Semyon Sadetsky area=dnd
@run applet HTMLTransferTest.html
-->
<head>
<title> </title>
</head>
<body>
<h1>HTMLTransferTest<br>Bug ID: 6392086</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="HTMLTransferTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,26 +22,19 @@
*/
/*
@test
@key headful
@bug 6392086 8014725
@summary Tests basic DnD functionality in an applet
@author Alexey Utkin, Semyon Sadetsky
@run applet HTMLTransferTest.html
@summary tests that HTMLs of all supported native HTML formats are transfered
properly
@run main/othervm HTMLTransferTest
*/
/**
* HTMLTransferTest.java
*
* summary: tests that HTMLs of all supported native HTML formats
* are transfered properly
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.datatransfer.*;
import java.io.*;
public class HTMLTransferTest extends Applet {
public class HTMLTransferTest {
public static final int CODE_NOT_RETURNED = 100;
public static final int CODE_CONSUMER_TEST_FAILED = 101;
public static final int CODE_FAILURE = 102;
@ -66,6 +59,12 @@ public class HTMLTransferTest extends Applet {
private THTMLProducer imPr;
private int returnCode = CODE_NOT_RETURNED;
public static void main(final String[] args) {
HTMLTransferTest app = new HTMLTransferTest();
app.init();
app.start();
}
public void init() {
initImpl();

@ -1,45 +0,0 @@
<!--
Copyright (c) 2007, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6533175
@summary Block F10 if closest toplevel to keystroke target is not a Frame.
@author yuri nesterenko : area= awt.toplevel
@run applet F10TopToplevel.html
-->
<head>
<title> </title>
</head>
<body>
<h1>F10TopToplevel<br>Bug ID: 6533175 Pressing F10 when a modal dialog is visible hangs the Xserver, XToolkit</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="F10TopToplevel.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, 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
@ -20,51 +20,25 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
test
@test
@key headful
@bug 6533175
@summary Block F10 if closest toplevel to keystroke target is not a Frame.
@author yuri nesterenko : area=awt.toplevel
@run applet F10TopToplevel.html
@run main F10TopToplevel
*/
/**
* F10TopToplevel.java
*
* summary: tests if F10 has no effect if focused toplevel if not Frame
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class F10TopToplevel {
public class F10TopToplevel extends Applet
{
//Declare things used in the test, like buttons and labels here
Frame frame;
Dialog dialog;
volatile boolean menuToggled = false;
static Frame frame;
static Dialog dialog;
static volatile boolean menuToggled = false;
public void init()
{
setLayout (new BorderLayout ());
}//End init()
public void start ()
{
//Get things going. Request focus, set size, et cetera
setSize (200,200);
setVisible(true);
validate();
//What would normally go into main() will probably go here.
//Use System.out.println for diagnostic messages that you want
//to read after the test is done.
public static void main(final String[] args) {
MenuBar mb;
Menu menu;
MenuItem item;
@ -115,6 +89,5 @@ public class F10TopToplevel extends Applet
throw new RuntimeException("Oops! Menu should not open.");
}
}// start()
}
}// class F10TopToplevel

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, 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
@ -39,9 +39,8 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class BorderTest extends Applet {
public class BorderTest extends Panel {
Panel panel1;
Panel panel2;
@ -108,8 +107,6 @@ public class BorderTest extends Applet {
} );
BorderTest BorderTest = new BorderTest();
BorderTest.init();
BorderTest.start();
f.add("Center", BorderTest);
f.setSize(450, 300);

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, 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
@ -39,9 +39,8 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class FlowTest extends Applet {
public class FlowTest extends Panel {
Panel panel;
public FlowTest() {
@ -141,8 +140,6 @@ public class FlowTest extends Applet {
} );
FlowTest flowTest = new FlowTest();
flowTest.init();
flowTest.start();
f.add("Center", flowTest);
f.setSize(300, 300);

@ -1,47 +0,0 @@
<!--
Copyright (c) 1998, 2017, 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.
-->
<HTML>
<!-- @test
@key headful
@bug 4023283
@summary Checks that an Error which propogate up to the EventDispatch
loop does not crash AWT.
@author Andrei Dmitriev: area=awt.event
@library ../../regtesthelpers
@modules java.desktop/sun.awt
@build Util
@run main LoopRobustness
-->
<HEAD>
<TITLE>LoopRobustness</TITLE>
</HEAD>
<BODY>
This is automatic test.
<APPLET CODE="LoopRobustness.class"
CODEBASE = "."
WIDTH=350 HEIGHT=100>
</APPLET>
</BODY>
</HTML>

@ -22,13 +22,14 @@
*/
/**
*
* @test
* @bug 4023283
* @key headful
* @summary Checks that an Error which propogates up to the EventDispatch
* loop does not crash AWT.
* @author Andrei Dmitriev: area=awt.event
* @library ../../regtesthelpers
* @modules java.desktop/sun.awt
* @build Util
* @run main LoopRobustness
*/

@ -1,47 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6448069
@summary namefilter is not called for file dialog on windows
@author oleg.sukhodolsky: area= awt.filedialog
@library ../../regtesthelpers
@build Util
@run applet FilenameFilterTest.html
-->
<head>
<title> </title>
</head>
<body>
<h1>FilenameFilterTest<br>Bug ID: 6448069 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="FilenameFilterTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2018, 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
@ -22,20 +22,15 @@
*/
/*
test
@test
@key headful
@bug 6448069
@summary namefilter is not called for file dialog on windows
@author oleg.sukhodolsky: area= awt.filedialog
@run applet FilenameFilterTest.html
@library ../../regtesthelpers
@build Util
@run main FilenameFilterTest
*/
/**
* FilenameFilterTest.java
*
* summary: namefilter is not called for file dialog on windows
*/
import java.applet.Applet;
import java.awt.*;
import java.io.File;
@ -43,28 +38,12 @@ import java.io.FilenameFilter;
import test.java.awt.regtesthelpers.Util;
public class FilenameFilterTest extends Applet
{
//Declare things used in the test, like buttons and labels here
volatile boolean filter_was_called = false;
FileDialog fd;
public class FilenameFilterTest {
public void init()
{
// Set up the environment -- set the layout manager, add
// buttons, etc.
setLayout (new BorderLayout ());
}//End init()
public void start ()
{
//Get things going. Request focus, set size, et cetera
setSize (200,200);
setVisible(true);
validate();
static volatile boolean filter_was_called = false;
static FileDialog fd;
public static void main(final String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
fd = new FileDialog(new Frame(""), "hello world", FileDialog.LOAD);
@ -93,6 +72,5 @@ public class FilenameFilterTest extends Applet
if (!filter_was_called) {
throw new RuntimeException("Filter was not called");
}
}// start()
}
}// class FilenameFilterTest

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,7 +26,6 @@
@key headful
@bug 6314575
@summary Tests that previosly focused owned window doesn't steal focus when an owner's component requests focus.
@author Anton.Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main ActualFocusedWindowBlockingTest
@ -34,12 +33,9 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class ActualFocusedWindowBlockingTest extends Applet {
public class ActualFocusedWindowBlockingTest {
Robot robot = Util.createRobot();
Frame owner = new Frame("Owner Frame");
Window win = new Window(owner);

@ -26,7 +26,6 @@
@key headful
@bug 4823903
@summary Tests actual focused window retaining.
@author Anton.Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main ActualFocusedWindowRetaining
@ -34,11 +33,9 @@
import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.*;
import java.applet.*;
import test.java.awt.regtesthelpers.Util;
public class ActualFocusedWindowRetaining extends Applet {
public class ActualFocusedWindowRetaining {
public static Frame frame = new Frame("Other Frame");
public static Frame owner = new Frame("Test Frame");
public static Button otherButton1 = new Button("Other Button 1");
@ -54,7 +51,6 @@ public class ActualFocusedWindowRetaining extends Applet {
public static void main(String[] args) {
ActualFocusedWindowRetaining a = new ActualFocusedWindowRetaining();
a.init();
a.start();
}
@ -76,10 +72,6 @@ public class ActualFocusedWindowRetaining extends Applet {
}
}, AWTEvent.WINDOW_EVENT_MASK | AWTEvent.WINDOW_FOCUS_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK);
setSize (500, 200);
setVisible(true);
validate();
frame.setSize(new Dimension(400, 100));
frame.setLocation(800, 400);
frame.setVisible(true);

@ -1,47 +0,0 @@
<!--
Copyright (c) 2008, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 4041703 4096228 4025223 4260929
@summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
@author das area=appletviewer
@library ../../regtesthelpers
@build Util
@run applet AppletInitialFocusTest.html
-->
<head>
<title> AppletInitialFocusTest </title>
</head>
<body>
<h1>AppletInitialFocusTest<br>Bug ID: 4041703</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="AppletInitialFocusTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -22,30 +22,42 @@
*/
/*
test
@bug 4041703 4096228 4025223 4260929
@test
@key headful
@bug 4041703 4096228 4025223 4260929
@summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
@author das area=appletviewer
@run applet AppletInitialFocusTest.html
@library ../../regtesthelpers
@build Util
@run main AppletInitialFocusTest
*/
import java.applet.Applet;
import java.awt.Button;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Robot;
import java.awt.Window;
import test.java.awt.regtesthelpers.Util;
public class AppletInitialFocusTest extends Applet {
public class AppletInitialFocusTest extends Frame {
Robot robot = Util.createRobot();
Button button = new Button("Button");
public void init() {
add(button);
public static void main(final String[] args) throws Exception {
AppletInitialFocusTest app = new AppletInitialFocusTest();
app.init();
app.start();
}
public void start() {
new Thread(new Runnable() {
public void init() {
setSize(200, 200);
setLocationRelativeTo(null);
setLayout(new FlowLayout());
add(button);
setVisible(true);
}
public void start() throws Exception {
Thread thread = new Thread(new Runnable() {
public void run() {
Util.waitTillShown(button);
robot.delay(1000); // delay the thread to let EDT to start dispatching focus events
@ -54,6 +66,8 @@ public class AppletInitialFocusTest extends Applet {
throw new RuntimeException("Appletviewer doesn't set default focus correctly.");
}
}
}).start();
});
thread.start();
thread.join();
}
}

@ -1,48 +0,0 @@
<!--
Copyright (c) 2008, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 4411534 4517274
@summary ensures that user's requestFocus() during applet initialization
is not ignored
@author prs area=appletviewer
@library ../../regtesthelpers
@build Util
@run applet AppletInitialFocusTest1.html
-->
<head>
<title> AppletInitialFocusTest1 </title>
</head>
<body>
<h1>AppletInitialFocusTest1<br>Bug ID: 4517274</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="AppletInitialFocusTest1.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -21,18 +21,36 @@
* questions.
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class AppletInitialFocusTest1 extends Applet implements FocusListener {
/*
@test
@key headful
@bug 4411534 4517274
@summary ensures that user's requestFocus() during applet initialization
is not ignored
@library ../../regtesthelpers
@build Util
@run main AppletInitialFocusTest1
*/
public class AppletInitialFocusTest1 extends Frame implements FocusListener {
Button button1 = new Button("Button1");
Button button2 = new Button("Button2");
Object lock = new Object();
public static void main(final String[] args) throws Exception {
AppletInitialFocusTest1 app = new AppletInitialFocusTest1();
app.init();
Thread.sleep(10000);
}
public void init() {
setSize(200, 200);
setLocationRelativeTo(null);
setLayout(new FlowLayout());
Component parent = this;
while (parent != null && !(parent instanceof Window)) {
@ -52,34 +70,18 @@ public class AppletInitialFocusTest1 extends Applet implements FocusListener {
button2.addFocusListener(this);
add(button1);
add(button2);
setVisible(true);
button2.requestFocus();
}
public void focusGained(FocusEvent e) {
if (e.getSource() == button1) {
synchronized (lock) {
System.err.println("failed: focus on the wrong button");
System.exit(2);
throw new RuntimeException("failed: focus on the wrong button");
}
}
}
public void focusLost(FocusEvent e) {
}
public void start() {
Thread thread = new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(10000);
synchronized (lock) {
System.err.println("passed");
System.exit(0);
}
} catch(InterruptedException e) {
}
}
});
thread.start();
}
}

@ -26,20 +26,15 @@
@key headful
@bug 6187066
@summary Tests the Window.autoRequestFocus property for the Window.setVisible() method.
@author anton.tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main AutoRequestFocusSetVisibleTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class AutoRequestFocusSetVisibleTest extends Applet {
public class AutoRequestFocusSetVisibleTest {
static Frame focusedFrame;
static Button focusOwner;
static Frame frame;
@ -65,10 +60,6 @@ public class AutoRequestFocusSetVisibleTest extends Applet {
}
public void init() {
// Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
this.setLayout (new BorderLayout ());
toolkitClassName = Toolkit.getDefaultToolkit().getClass().getName();
}

@ -26,7 +26,6 @@
@key headful
@bug 6187066
@summary Tests the Window.autoRequestFocus property for the Window.toFront() method.
@author anton.tarasov: area=awt.focus
@library /java/awt/patchlib ../../regtesthelpers
@build java.desktop/java.awt.Helper
@build Util
@ -34,13 +33,9 @@
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class AutoRequestFocusToFrontTest extends Applet {
public class AutoRequestFocusToFrontTest {
static boolean haveDelays;
static Frame auxFrame;
@ -76,10 +71,6 @@ public class AutoRequestFocusToFrontTest extends Applet {
}
public void init() {
// Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
this.setLayout (new BorderLayout ());
toolkitClassName = Toolkit.getDefaultToolkit().getClass().getName();
}

@ -1,44 +0,0 @@
<!--
Copyright (c) 2004, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 5090325
@summary Tests that Window's child can be focused on XAWT.
@author anton.tarasov@sun.com: area=awt.focus
@run applet ChildWindowFocusTest.html
-->
<head>
<title>ChildWindowFocusTest</title>
</head>
<body>
<h1>ChildWindowFocusTest<br>Bug ID: 5090325</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="ChildWindowFocusTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,19 +22,17 @@
*/
/*
test
@test
@key headful
@bug 5090325
@summary Tests that Window's child can be focused on XAWT.
@author anton.tarasov@sun.com: area=awt.focus
@run applet ChildWindowFocusTest.html
@run main ChildWindowFocusTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.lang.reflect.*;
public class ChildWindowFocusTest extends Applet {
public class ChildWindowFocusTest {
Robot robot;
Frame frame = new Frame("Owner");
Button button0 = new Button("button-0");
@ -46,16 +44,18 @@ public class ChildWindowFocusTest extends Applet {
Button button1 = new Button("button-1");
int shift;
public static void main(final String[] args) {
ChildWindowFocusTest app = new ChildWindowFocusTest();
app.init();
app.start();
}
public void init() {
try {
robot = new Robot();
} catch (AWTException e) {
throw new RuntimeException("Error: unable to create robot", e);
}
// Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
this.setLayout (new BorderLayout ());
shift = 100;
}

@ -26,7 +26,6 @@
@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
@ -35,11 +34,10 @@
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");
@ -60,11 +58,6 @@ public class ClearLwQueueBreakTest extends Applet {
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() {
@ -118,6 +111,7 @@ public class ClearLwQueueBreakTest extends Applet {
f1.add(tf3);
f1.setLayout(new FlowLayout());
f1.pack();
f1.setLocationRelativeTo(null);
f1.setVisible(true);
Util.waitForIdle(robot);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,20 +26,15 @@
@key headful
@bug 6785058
@summary Tests that an owner is activated on closing its owned dialog with the warning icon.
@author Anton Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main/othervm/policy=java.policy -Djava.security.manager CloseDialogActivateOwnerTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class CloseDialogActivateOwnerTest extends Applet {
public class CloseDialogActivateOwnerTest {
Robot robot;
public static void main(String[] args) {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -22,11 +22,10 @@
*/
/*
@test %W% %E%
@test
@key headful
@bug 6637607
@summary Showing a modal dlg on TAB KEY_PRESS shouldn't consume inappropriate KEY_TYPED.
@author Anton Tarasov: area=awt-focus
@library ../../regtesthelpers
@build Util
@run main ConsumeNextKeyTypedOnModalShowTest
@ -34,12 +33,9 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class ConsumeNextKeyTypedOnModalShowTest extends Applet {
public class ConsumeNextKeyTypedOnModalShowTest {
Robot robot;
Frame frame = new Frame("Frame");
Dialog dialog = new Dialog(frame, "Dialog", true);
@ -76,6 +72,7 @@ public class ConsumeNextKeyTypedOnModalShowTest extends Applet {
}
public void start() {
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Util.waitTillShown(frame);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,13 +26,11 @@
@key headful
@bug 6607170
@summary Tests for focus-auto-transfer.
@author Anton Tarasov: area=awt-focus
@library ../../regtesthelpers
@build Util
@run main ContainerFocusAutoTransferTest
*/
import java.applet.Applet;
import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.ComponentOrientation;
@ -50,7 +48,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import test.java.awt.regtesthelpers.Util;
public class ContainerFocusAutoTransferTest extends Applet {
public class ContainerFocusAutoTransferTest {
Robot robot;
TestFrame frame;
KeyboardFocusManager kfm;

@ -1,46 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6480534
@summary A Frame changing its state from ICONIFIED to NORMAL should regain focus.
@author anton.tarasov@...: area=awt.focus
@library ../../regtesthelpers
@build Util
@run applet DeiconifiedFrameLoosesFocus.html
-->
<head>
<title>DeiconifiedFrameLoosesFocus</title>
</head>
<body>
<h1>DeiconifiedFrameLoosesFocus<br>Bug ID: 6480534</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=DeiconifiedFrameLoosesFocus.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2018, 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
@ -22,18 +22,19 @@
*/
/*
test
@bug 6480534
@summary A Frame changing its state from ICONIFIED to NORMAL should regain focus.
@author anton.tarasov@...: area=awt.focus
@run applet DeiconifiedFrameLoosesFocus.html
@test
@key headful
@bug 6480534
@summary A Frame changing its state from ICONIFIED to NORMAL should regain focus.
@library ../../regtesthelpers
@build Util
@run main DeiconifiedFrameLoosesFocus
*/
import java.awt.*;
import java.applet.Applet;
import test.java.awt.regtesthelpers.Util;
public class DeiconifiedFrameLoosesFocus extends Applet {
public class DeiconifiedFrameLoosesFocus {
Robot robot;
static final Frame frame = new Frame("Frame");
@ -45,11 +46,6 @@ public class DeiconifiedFrameLoosesFocus extends Applet {
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() {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, 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
@ -26,7 +26,6 @@
* @key headful
* @bug 6516675
* @summary Tests that EmbeddedFrame can be focused.
* @author anton.tarasov: area=awt-focus
* @requires (os.family == "windows")
* @modules java.desktop/java.awt.peer
* java.desktop/sun.awt
@ -39,13 +38,10 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
import test.java.awt.regtesthelpers.UtilInternal;
public class FocusEmbeddedFrameTest extends Applet {
public class FocusEmbeddedFrameTest {
static Frame embedder = new Frame("Embedder");
static Frame ef = null;
static volatile boolean passed;

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2018, 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
@ -22,11 +22,10 @@
*/
/*
@test FocusOwnerFrameOnClick.java %W% %E%
@test
@key headful
@bug 6886678
@summary Tests that clicking an owner frame switches focus from its owned window.
@author Anton Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main FocusOwnerFrameOnClick
@ -34,12 +33,10 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class FocusOwnerFrameOnClick extends Applet {
public class FocusOwnerFrameOnClick {
Robot robot;
Frame frame = new Frame("Frame");
Window window = new Window(frame);

@ -1,44 +0,0 @@
<!--
Copyright (c) 2004, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 5082319
@summary Tests that focus request for already focused component doesn't block key events.
@author anton.tarasov@sun.com
@run applet FocusSubRequestTest.html
-->
<head>
<title>FocusSubRequestTest</title>
</head>
<body>
<h1>FocusSubRequestTest<br>Bug ID: 5082319</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="FocusSubRequestTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2018, 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
@ -22,23 +22,28 @@
*/
/*
test
@test
@key headful
@bug 5082319
@summary Tests that focus request for already focused component doesn't block key events.
@author anton.tarasov@sun.com
@run applet FocusSubRequestTest.html
@run main FocusSubRequestTest
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class FocusSubRequestTest extends Applet {
public class FocusSubRequestTest {
Frame frame = new Frame("Test Frame");
Button button = new Button("button");
boolean passed = false;
Robot robot;
public static void main(final String[] args) {
FocusSubRequestTest app = new FocusSubRequestTest();
app.init();
app.start();
}
public void init() {
frame.add(button);
button.addFocusListener(new FocusAdapter() {
@ -64,7 +69,7 @@ public class FocusSubRequestTest extends Applet {
public void start() {
frame.pack();
frame.setLocation(getLocation().x + getSize().width + 20, 0);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
waitTillShown(button);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,26 +26,19 @@
* @key headful
* @bug 4752312
* @summary Tests that after moving non-focusable window it ungrabs mouse pointer
* @author Denis Mikhalkin: area=awt.focus
* @library ../../regtesthelpers
* @build Util
* @run main FrameJumpingToMouse
*/
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Point;
import java.awt.Robot;
import java.awt.TextArea;
import java.awt.Toolkit;
import java.awt.event.InputEvent;
import javax.swing.JFrame;
import test.java.awt.regtesthelpers.Util;
public class FrameJumpingToMouse extends Applet
{
public class FrameJumpingToMouse {
JFrame frame = new JFrame("Test jumping frame");
Robot robot = Util.createRobot();

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,18 +26,16 @@
@key headful
@bug 6522725
@summary Tests for proper request-focus-back on FOCUS_LOST.
@author Anton Tarasov: area=awt-focus
@library ../../regtesthelpers
@build Util
@run main IconifiedFrameFocusChangeTest
*/
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import test.java.awt.regtesthelpers.Util;
public class IconifiedFrameFocusChangeTest extends Applet {
public class IconifiedFrameFocusChangeTest {
Frame testFrame = new Frame("Test Frame");
Frame otherFrame = new Frame("Other Frame");
Button testButton = new Button("test button");

@ -1,46 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6426132
@summary Modal blocked window shouldn't steal focus when shown, or brought to front.
@author anton.tarasov@...: area=awt.focus
@library ../../regtesthelpers
@build Util
@run applet ModalBlockedStealsFocusTest.html
-->
<head>
<title>ModalBlockedStealsFocusTest</title>
</head>
<body>
<h1>ModalBlockedStealsFocusTest<br>Bug ID: 6426132</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=ModalBlockedStealsFocusTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,38 +22,30 @@
*/
/*
test
@bug 6426132
@summary Modal blocked window shouldn't steal focus when shown, or brought to front.
@author anton.tarasov@...: area=awt.focus
@run applet ModalBlockedStealsFocusTest.html
@test
@key headful
@bug 6426132
@summary Modal blocked window shouldn't steal focus when shown, or brought to front.
@library ../../regtesthelpers
@build Util
@run main ModalBlockedStealsFocusTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class ModalBlockedStealsFocusTest extends Applet {
public class ModalBlockedStealsFocusTest {
Frame frame = new Frame("Blocked Frame");
Dialog dialog = new Dialog(frame, "Modal Dialog", Dialog.ModalityType.TOOLKIT_MODAL);
AtomicBoolean lostFocus = new AtomicBoolean(false);
public static void main(String[] args) {
ModalBlockedStealsFocusTest app = new ModalBlockedStealsFocusTest();
app.init();
app.start();
}
public void init() {
// 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() {
if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
System.out.println("The test is not for MToolkit.");

@ -1,44 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6382750
@summary
@author anton.tarasov@sun.com: area=awt.focus
@run applet ModalDialogInitialFocusTest.html
-->
<head>
<title>ModalDialogInitialFocusTest</title>
</head>
<body>
<h1>ModalDialogInitialFocusTest<br>Bug ID: 6382750</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=ModalDialogInitialFocusTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,20 +22,17 @@
*/
/*
test
@bug 6382750
@test
@key headful
@bug 6382750
@summary Tests that modal dialog doesn't request extra initial focus on show.
@author anton.tarasov@sun.com: area=awt.focus
@run applet ModalDialogInitialFocusTest.html
@run main ModalDialogInitialFocusTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
public class ModalDialogInitialFocusTest extends Applet {
public class ModalDialogInitialFocusTest {
Robot robot;
Dialog dialog = new Dialog((Window)null, "Test Dialog", Dialog.ModalityType.TOOLKIT_MODAL);
@ -55,10 +52,6 @@ public class ModalDialogInitialFocusTest extends Applet {
} catch (AWTException e) {
throw new RuntimeException("Error: unable to create robot", e);
}
// 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() {

@ -1,45 +0,0 @@
<!--
Copyright (c) 2005, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6271849
@summary Tests that component in modal excluded Window which parent is blocked responses to mouse clicks.
@author anton.tarasov@sun.com: area=awt.focus
@modules java.desktop/sun.awt
@run applet ModalExcludedWindowClickTest.html
-->
<head>
<title>ModalExcludedWindowClickTest</title>
</head>
<body>
<h1>ModalExcludedWindowClickTest<br>Bug ID: 6272324</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="ModalExcludedWindowClickTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,19 +22,19 @@
*/
/*
test
@bug 6271849
@summary Tests that component in modal excluded Window which parent is blocked responses to mouse clicks.
@author anton.tarasov@sun.com: area=awt.focus
@run applet ModalExcludedWindowClickTest.html
@test
@key headful
@bug 6271849
@summary Tests that component in modal excluded Window which parent is blocked responses to mouse clicks.
@modules java.desktop/sun.awt
@run main ModalExcludedWindowClickTest
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.*;
public class ModalExcludedWindowClickTest extends Applet {
public class ModalExcludedWindowClickTest {
Robot robot;
Frame frame = new Frame("Frame");
Window w = new Window(frame);
@ -54,10 +54,6 @@ public class ModalExcludedWindowClickTest extends Applet {
} catch (AWTException e) {
throw new RuntimeException("Error: unable to create robot", e);
}
// 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() {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,7 +26,6 @@
@key headful
@bug 4685768
@summary Tests that auto-transfering focus doesn't stuck on a disabled component.
@author Anton Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main NoAutotransferToDisabledCompTest
@ -36,10 +35,9 @@ import java.awt.Robot;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import test.java.awt.regtesthelpers.Util;
public class NoAutotransferToDisabledCompTest extends Applet {
public class NoAutotransferToDisabledCompTest {
Robot robot;
JFrame frame = new JFrame("Frame");
JButton b0 = new JButton("b0");

@ -1,45 +0,0 @@
<!--
Copyright (c) 2005, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6272324
@summary Modal excluded Window which decorated parent is blocked should be non-focusable.
@author anton.tarasov@sun.com: area=awt.focus
@modules java.desktop/sun.awt
@run applet NonFocusableBlockedOwnerTest.html
-->
<head>
<title>NonFocusableBlockedOwnerTest</title>
</head>
<body>
<h1>NonFocusableBlockedOwnerTest<br>Bug ID: 6272324</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="NonFocusableBlockedOwnerTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,19 +22,19 @@
*/
/*
test
@bug 6272324
@summary Modal excluded Window which decorated parent is blocked should be non-focusable.
@author anton.tarasov@sun.com: area=awt.focus
@run applet NonFocusableBlockedOwnerTest.html
@test
@key headful
@bug 6272324
@summary Modal excluded Window which decorated parent is blocked should be non-focusable.
@modules java.desktop/sun.awt
@run main NonFocusableBlockedOwnerTest
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.*;
public class NonFocusableBlockedOwnerTest extends Applet {
public class NonFocusableBlockedOwnerTest {
Robot robot;
Frame frame = new Frame("Modal Blocked Frame");
Dialog dialog = new Dialog(frame, "Modal Dialog", true);
@ -53,10 +53,6 @@ public class NonFocusableBlockedOwnerTest extends Applet {
} catch (AWTException e) {
throw new RuntimeException("Error: unable to create robot", e);
}
// 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() {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,7 +26,6 @@
@key headful
@bug 6182359
@summary Tests that Window having non-focusable owner can't be a focus owner.
@author Anton.Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main NonfocusableOwnerTest
@ -34,12 +33,9 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.lang.reflect.*;
import java.io.*;
import test.java.awt.regtesthelpers.Util;
public class NonfocusableOwnerTest extends Applet {
public class NonfocusableOwnerTest {
Robot robot = Util.createRobot();
Frame frame;
Dialog dialog;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,7 +26,6 @@
@key headful
@bug 4685768
@summary Tests that it's possible to manually request focus on a disabled component.
@author Anton Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main RequestFocusToDisabledCompTest
@ -35,11 +34,9 @@
import java.awt.Robot;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import test.java.awt.regtesthelpers.Util;
public class RequestFocusToDisabledCompTest extends Applet {
public class RequestFocusToDisabledCompTest {
Robot robot;
JFrame frame = new JFrame("Frame");
JButton b0 = new JButton("b0");

@ -26,15 +26,12 @@
@key headful
@bug 8013773
@summary Tests that disabled component is not retained as most recent focus owner.
@author Anton.Tarasov: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main ResetMostRecentFocusOwnerTest
*/
import java.applet.Applet;
import java.awt.AWTEvent;
import java.awt.FlowLayout;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.AWTEventListener;
@ -44,15 +41,13 @@ import javax.swing.JButton;
import javax.swing.JFrame;
import test.java.awt.regtesthelpers.Util;
public class ResetMostRecentFocusOwnerTest extends Applet {
public class ResetMostRecentFocusOwnerTest {
public static void main(String[] args) {
ResetMostRecentFocusOwnerTest app = new ResetMostRecentFocusOwnerTest();
app.init();
app.start();
}
@Override
public void start() {
Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
@ -68,7 +63,7 @@ public class ResetMostRecentFocusOwnerTest extends Applet {
final JButton b1 = new JButton("button1");
frame1.add(b1);
frame1.pack();
frame1.setLocation(0, 300);
frame1.setLocation(100, 300);
Util.showWindowWait(frame1);

@ -22,11 +22,10 @@
*/
/*
@test %W% %E%
@test
@key headful
@bug 6598089
@summary Tests restoring focus on a single disabled coponent
@author Anton Tarasov: area=awt-focus
@library ../../regtesthelpers
@build Util
@run main RestoreFocusOnDisabledComponentTest
@ -34,13 +33,12 @@
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import test.java.awt.regtesthelpers.Util;
/*
* The bug is not reproducible on Windows.
*/
public class RestoreFocusOnDisabledComponentTest extends Applet {
public class RestoreFocusOnDisabledComponentTest {
Frame frame = new Frame("Frame") {public String toString() {return "FRAME";}};
Button b0 = new Button("button0") {public String toString() {return "B-0";}};
Button b1 = new Button("button1") {public String toString() {return "B-1";}};
@ -62,7 +60,7 @@ public class RestoreFocusOnDisabledComponentTest extends Applet {
frame.add(b1);
frame.setLayout(new FlowLayout());
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Util.waitForIdle(robot);

@ -28,18 +28,14 @@
@summary Tests that showing a toplvel in a not foreground Java process activates it.
@library ../../regtesthelpers
@build Util
@author Anton Tarasov: area=awt-focus
@run main ShowFrameCheckForegroundTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class ShowFrameCheckForegroundTest extends Applet {
public class ShowFrameCheckForegroundTest {
Robot robot;
Frame nofocusFrame = new Frame("Non-focusable");
Frame frame = new Frame("Frame");
@ -76,6 +72,7 @@ public class ShowFrameCheckForegroundTest extends Applet {
nofocusFrame.add(showButton);
nofocusFrame.pack();
nofocusFrame.setFocusableWindowState(false);
nofocusFrame.setLocation(200, 200);
nofocusFrame.setVisible(true);
Util.waitForIdle(robot);
@ -97,7 +94,7 @@ public class ShowFrameCheckForegroundTest extends Applet {
private void test(Window toplevel, int stage) {
toplevel.add(testButton);
toplevel.pack();
toplevel.setLocation(200, 0);
toplevel.setLocation(400, 200);
switch (stage) {
case 1:

@ -1,49 +0,0 @@
<!--
Copyright (c) 2002, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 4092033 4529626
@summary Tests that toFront makes window focused unless it is non-focusable
@author area=awt.focus
@library ../../regtesthelpers
@build Util
@run applet ToFrontFocus.html
-->
<head>
<title> </title>
</head>
<body>
<h1>ToFrontFocus<br>
4092033 : (P4/S5) - window.toFront() method is now also setting focus
4529626 : (P4/S2) - REGRESSION:In solaris and Linux ,toFront() is not making frame as the Focused.
</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="ToFrontFocus.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,39 +22,32 @@
*/
/*
test
@test
@key headful
@bug 4092033 4529626
@summary Tests that toFront makes window focused unless it is non-focusable
@author area=awt.focus
@run applet ToFrontFocus.html
@library ../../regtesthelpers
@build Util
@run main ToFrontFocus
*/
/**
* ToFrontFocus.java
*
* summary:
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import test.java.awt.regtesthelpers.Util;
public class ToFrontFocus extends Applet
{
//Declare things used in the test, like buttons and labels here
public class ToFrontFocus {
Frame cover, focus_frame, nonfocus_frame;
Button focus_button, nonfocus_button;
volatile boolean focus_gained = false, nonfocus_gained = false;
public void init()
public static void main(final String[] args) {
ToFrontFocus app = new ToFrontFocus();
app.init();
app.start();
}
public void init()
{
//Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
this.setLayout (new BorderLayout ());
cover = new Frame("Cover frame");
cover.setBounds(100, 100, 200, 200);
focus_frame = new Frame("Focusable frame");
@ -78,9 +71,6 @@ public class ToFrontFocus extends Applet
public void start ()
{
//Get things going. Request focus, set size, et cetera
setSize (200,200);
show();
Util.waitForIdle(null);
focus_frame.setFocusTraversalPolicy(new DefaultFocusTraversalPolicy() {

@ -1,46 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6426132
@summary A Window should be focused upon start (XAWT bug).
@author anton.tarasov@...: area=awt.focus
@library ../../regtesthelpers
@build Util
@run applet WindowInitialFocusTest.html
-->
<head>
<title>WindowInitialFocusTest</title>
</head>
<body>
<h1>WindowInitialFocusTest<br>Bug ID: 6426132</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=WindowInitialFocusTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,20 +22,21 @@
*/
/*
test
@bug 6426132
@summary A Window should be initially focused on its showing (XAWT bug).
@author anton.tarasov@...: area=awt.focus
@run applet WindowInitialFocusTest.html
@test
@key headful
@bug 6426132
@summary A Window should be focused upon start (XAWT bug).
@library ../../regtesthelpers
@build Util
@run main WindowInitialFocusTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import test.java.awt.regtesthelpers.Util;
public class WindowInitialFocusTest extends Applet {
public class WindowInitialFocusTest {
Frame frame = new Frame("Test Frame");
Window window = new Window(frame);
Button button = new Button("button");
@ -44,17 +45,9 @@ public class WindowInitialFocusTest extends Applet {
public static void main(String[] args) {
WindowInitialFocusTest app = new WindowInitialFocusTest();
app.init();
app.start();
}
public void init() {
// 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() {
frame.setBounds(800, 0, 200, 100);
window.setBounds(800, 200, 200, 100);

@ -1,45 +0,0 @@
<!--
Copyright (c) 2005, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6253913
@summary Tests that a Window shown before its owner is focusable.
@author anton.tarasov@sun.com: area=awt-focus
@modules java.desktop/sun.awt
@run applet WindowUpdateFocusabilityTest.html
-->
<head>
<title>WindowUpdateFocusabilityTest</title>
</head>
<body>
<h1>WindowUpdateFocusabilityTest<br>Bug ID: 6253913</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=WindowUpdateFocusabilityTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,19 +22,19 @@
*/
/*
test
@bug 6253913
@summary Tests that a Window shown before its owner is focusable.
@author anton.tarasov@sun.com: area=awt-focus
@run applet WindowUpdateFocusabilityTest.html
@test
@key headful
@bug 6253913
@summary Tests that a Window shown before its owner is focusable.
@modules java.desktop/sun.awt
@run main WindowUpdateFocusabilityTest
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.lang.reflect.*;
public class WindowUpdateFocusabilityTest extends Applet {
public class WindowUpdateFocusabilityTest {
Robot robot;
boolean focusGained = false;
final Object monitor = new Object();
@ -60,10 +60,6 @@ public class WindowUpdateFocusabilityTest extends Applet {
} catch (AWTException e) {
throw new RuntimeException("Error: couldn't create robot");
}
// 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() {

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -26,24 +26,15 @@
@key headful
@bug 4782886
@summary FocusManager consumes wrong KEY_TYPED events
@author Oleg.Sukhodolsky: area=awt.focus
@library ../../regtesthelpers
@build Util
@run main WrongKeyTypedConsumedTest
*/
import java.applet.Applet;
import java.awt.AWTException;
import java.awt.AWTKeyStroke;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Robot;
import java.awt.TextArea;
import java.awt.event.KeyEvent;
@ -56,7 +47,7 @@ import javax.swing.JTextArea;
import test.java.awt.regtesthelpers.Util;
public class WrongKeyTypedConsumedTest extends Applet
public class WrongKeyTypedConsumedTest
{
Robot robot = Util.createRobot();
@ -67,10 +58,6 @@ public class WrongKeyTypedConsumedTest extends Applet
public void start ()
{
setSize (200,200);
setVisible(true);
validate();
JFrame frame = new JFrame("The Frame");
Set ftk = new HashSet();
ftk.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_DOWN, 0));
@ -85,6 +72,7 @@ public class WrongKeyTypedConsumedTest extends Applet
frame.getContentPane().add(textarea);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Util.waitForIdle(robot);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, 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
@ -21,12 +21,23 @@
* questions.
*/
import java.applet.*;
import java.awt.*;
import java.io.*;
import java.net.*;
import java.awt.Font;
import java.awt.FontFormatException;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Paths;
public class BigFont extends Applet {
/**
* @test
* @key headful
* @bug 6522586
* @summary Enforce limits on font creation
* @run main BigFont 1 A.ttf
* @run main BigFont 2 A.ttf
*/
public class BigFont {
static private class SizedInputStream extends InputStream {
@ -51,12 +62,12 @@ public class BigFont extends Applet {
}
}
String id;
String fileName;
static String id;
static String fileName;
public void init() {
id = getParameter("number");
fileName = getParameter("font");
public static void main(final String[] args) {
id = args[0];
fileName = args[1];
System.out.println("Applet " + id + " "+
Thread.currentThread().getThreadGroup());
@ -102,7 +113,10 @@ public class BigFont extends Applet {
int getFileSize(String fileName) {
try {
URL url = new URL(getCodeBase(), fileName);
String path = Paths.get(System.getProperty("test.src", "."),
fileName).toAbsolutePath().normalize()
.toString();
URL url = new URL(path);
InputStream inStream = url.openStream();
BufferedInputStream fontStream = new BufferedInputStream(inStream);
int size = 0;
@ -123,7 +137,10 @@ public class BigFont extends Applet {
boolean gotException = false;
for (int i=0; i<fontCnt; i++) {
try {
URL url = new URL(getCodeBase(), fileName);
String path = Paths.get(System.getProperty("test.src", "."),
fileName).toAbsolutePath().normalize()
.toString();
URL url = new URL(path);
InputStream inStream = url.openStream();
BufferedInputStream fontStream =
new BufferedInputStream(inStream);

@ -1,49 +0,0 @@
<!--
Copyright (c) 2008, 2016, 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.
@test
@key headful
@bug 6522586
@run applet bigfont.html
@summary Enforce limits on font creation
-->
<html>
<head>
<title>Test Font Creation Limits</title>
</head>
<body>
<hr>
<APPLET CODE = BigFont.class WIDTH = 100 HEIGHT = 100 >
<param name="number" value="1">
<param name="font" value="A.ttf">
</APPLET>
<APPLET CODE = BigFont.class WIDTH = 100 HEIGHT = 100>
<param name="number" value="2">
<param name="font" value="A.ttf">
</APPLET>
<hr>
</body>
</html>

@ -1,22 +0,0 @@
<html>
<!--
@test
@key headful
@bug 4051487 4145670
@summary Tests that disposing of an empty Frame or a Frame with a MenuBar
while it is being created does not crash the VM.
@author dpm area=Threads
@run applet/timeout=7200 DisposeStressTest.html
-->
<head>
<title>DisposeStressTest</title>
</head>
<body>
<h1>DisposeStressTest<br>Bug ID: 4051487, 4145670</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="DisposeStressTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -21,67 +21,23 @@
* questions.
*/
/*
test
@bug 4051487 4145670 8062021
@test
@key headful
@bug 4051487 4145670
@summary Tests that disposing of an empty Frame or a Frame with a MenuBar
while it is being created does not crash the VM.
@author dpm area=Threads
@run applet/timeout=7200 DisposeStressTest.html
@run main/timeout=7200 DisposeStressTest
*/
// Note there is no @ in front of test above. This is so that the
// harness will not mistake this file as a test file. It should
// only see the html file as a test file. (the harness runs all
// valid test files, so it would run this test twice if this file
// were valid as well as the html file.)
// Also, note the area= after Your Name in the author tag. Here, you
// should put which functional area the test falls in. See the
// AWT-core home page -> test areas and/or -> AWT team for a list of
// areas.
// Note also the 'DisposeStressTest.html' in the run tag. This should
// be changed to the name of the test.
import java.awt.Frame;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
public class DisposeStressTest {
/**
* DisposeStressTest.java
*
* summary:
*/
import java.applet.Applet;
import java.awt.*;
//Automated tests should run as applet tests if possible because they
// get their environments cleaned up, including AWT threads, any
// test created threads, and any system resources used by the test
// such as file descriptors. (This is normally not a problem as
// main tests usually run in a separate VM, however on some platforms
// such as the Mac, separate VMs are not possible and non-applet
// tests will cause problems). Also, you don't have to worry about
// synchronisation stuff in Applet tests they way you do in main
// tests...
public class DisposeStressTest extends Applet
{
//Declare things used in the test, like buttons and labels here
public void init()
{
//Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
this.setLayout (new BorderLayout ());
}//End init()
public void start ()
{
public static void main(final String[] args) {
for (int i = 0; i < 1000; i++) {
Frame f = new Frame();
f.setBounds(10, 10, 10, 10);
@ -98,6 +54,5 @@ public class DisposeStressTest extends Applet
f2.show();
f2.dispose();
}
}// start()
}// class DisposeStressTest
}
}

@ -1,45 +0,0 @@
<html>
<!--
Copyright (c) 2003, 2016, 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.
-->
<!--
@test
@key headful
@bug 4828019
@summary Frame/Window deadlock
@author yan@sparc.spb.su: area=
@run applet/timeout=9999 NonEDT_GUI_Deadlock.html
-->
<head>
<title> </title>
</head>
<body>
<h1>NonEDT_GUI_Deadlock<br>Bug ID: 4828019</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="NonEDT_GUI_Deadlock.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -21,70 +21,22 @@
* questions.
*/
/*
test
@test
@key headful
@bug 4828019
@summary Frame/Window deadlock
@author yan@sparc.spb.su: area=
@run applet NonEDT_GUI_Deadlock.html
@run main/timeout=9999 NonEDT_GUI_Deadlock
*/
// Note there is no @ in front of test above. This is so that the
// harness will not mistake this file as a test file. It should
// only see the html file as a test file. (the harness runs all
// valid test files, so it would run this test twice if this file
// were valid as well as the html file.)
// Also, note the area= after Your Name in the author tag. Here, you
// should put which functional area the test falls in. See the
// AWT-core home page -> test areas and/or -> AWT team for a list of
// areas.
// Note also the 'AutomaticAppletTest.html' in the run tag. This should
// be changed to the name of the test.
/**
* NonEDT_GUI_Deadlock.java
*
* summary:
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
//Automated tests should run as applet tests if possible because they
// get their environments cleaned up, including AWT threads, any
// test created threads, and any system resources used by the test
// such as file descriptors. (This is normally not a problem as
// main tests usually run in a separate VM, however on some platforms
// such as the Mac, separate VMs are not possible and non-applet
// tests will cause problems). Also, you don't have to worry about
// synchronisation stuff in Applet tests they way you do in main
// tests...
public class NonEDT_GUI_Deadlock extends Applet
{
//Declare things used in the test, like buttons and labels here
public class NonEDT_GUI_Deadlock {
boolean bOK = false;
Thread badThread = null;
public void init()
{
}//End init()
public void start ()
{
//Get things going. Request focus, set size, et cetera
setSize (200,300);
setVisible(true);
validate();
final Frame theFrame = new Frame("Window test");
theFrame.setSize(240, 200);
@ -164,7 +116,6 @@ public class NonEDT_GUI_Deadlock extends Applet
public static void main(String args[]) {
NonEDT_GUI_Deadlock imt = new NonEDT_GUI_Deadlock();
imt.init();
imt.start();
}

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, 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
@ -30,12 +30,10 @@
* on older Gnome versions (see bug 6500686).
* @run main FSFrame
* @run main/othervm -Dsun.java2d.noddraw=true FSFrame
* @author cheth
*/
import java.awt.*;
import java.awt.image.*;
import java.applet.*;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

@ -1,44 +0,0 @@
<html>
<!--
Copyright (c) 2009, 2016, 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.
@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
-->
<head>
<title> </title>
</head>
<body>
<h1>GridBagLayoutIpadXYTest<br>Bug ID: 5004032 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="GridBagLayoutIpadXYTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,32 +22,22 @@
*/
/*
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 class GridBagLayoutIpadXYTest {
static Frame frame = new Frame();
static TextField jtf = null;
static final int customIpadx = 300;
static final int customIpady = 40;
public void init()
{
this.setLayout (new BorderLayout ());
}//End init()
public void start ()
{
validate();
public static void main(final String[] args) {
frame.setLayout(new GridBagLayout());
GridBagConstraints gc = new GridBagConstraints();
Insets fieldInsets = new Insets(0,5,5,0);
@ -64,6 +54,7 @@ public class GridBagLayoutIpadXYTest extends Applet
frame.add(jtf, gc);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Robot robot;
@ -86,6 +77,5 @@ public class GridBagLayoutIpadXYTest extends Applet
throw new RuntimeException("Test Failed. TextField has incorrect width. ");
}
System.out.println("Test Passed.");
}// start()
}
}

@ -1,44 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6391688
@summary Tests that next mnemonic KeyTyped is consumed for a modal dialog.
@author anton.tarasov@sun.com: area=awt.focus
@run applet ConsumeForModalDialogTest.html
-->
<head>
<title>ConsumeForModalDialogTest</title>
</head>
<body>
<h1>ConsumeForModalDialogTest<br>Bug ID: 6391688</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=ConsumeForModalDialogTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -20,22 +20,20 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
test
@bug 6391688
@summary Tests that next mnemonic KeyTyped is consumed for a modal dialog.
@author anton.tarasov@sun.com: area=awt.focus
@run applet ConsumeForModalDialogTest.html
@test
@key headful
@bug 6391688
@summary Tests that next mnemonic KeyTyped is consumed for a modal dialog.
@run main ConsumeForModalDialogTest
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
public class ConsumeForModalDialogTest extends Applet {
public class ConsumeForModalDialogTest {
Robot robot;
JFrame frame = new JFrame("Test Frame");
JDialog dialog = new JDialog((Window)null, "Test Dialog", Dialog.ModalityType.DOCUMENT_MODAL);
@ -55,10 +53,6 @@ public class ConsumeForModalDialogTest extends Applet {
} catch (AWTException e) {
throw new RuntimeException("Error: unable to create robot", e);
}
// 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() {
@ -93,6 +87,7 @@ public class ConsumeForModalDialogTest extends Applet {
frame.setJMenuBar(menuBar);
frame.setSize(100, 100);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
robot.waitForIdle();

@ -1,46 +0,0 @@
<!--
Copyright (c) 2006, 2018, 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.
-->
<html>
<!--
@test
@key headful
@bug 6346690
@summary Tests that key_typed is consumed after mnemonic key_pressed is handled for a menu item.
@author anton.tarasov@sun.com: area=awt-focus
@library /test/lib
@build jdk.test.lib.Platform
@run applet ConsumeNextMnemonicKeyTypedTest.html
-->
<head>
<title>ConsumeNextMnemonicKeyTypedTest</title>
</head>
<body>
<h1>ConsumeNextMnemonicKeyTypedTest<br>Bug ID: 6346690</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=ConsumeNextMnemonicKeyTypedTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,13 +22,13 @@
*/
/*
test
@bug 6346690
@summary Tests that key_typed is consumed after mnemonic key_pressed is handled for a menu item.
@author anton.tarasov@sun.com: area=awt-focus
@library /test/lib
@build jdk.test.lib.Platform
@run applet ConsumeNextMnemonicKeyTypedTest.html
@test
@key headful
@bug 6346690
@summary Tests that key_typed is consumed after mnemonic key_pressed is handled for a menu item.
@library /test/lib
@build jdk.test.lib.Platform
@run main ConsumeNextMnemonicKeyTypedTest
*/
import jdk.test.lib.Platform;
@ -36,10 +36,8 @@ import jdk.test.lib.Platform;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.applet.Applet;
public class ConsumeNextMnemonicKeyTypedTest extends Applet {
public class ConsumeNextMnemonicKeyTypedTest {
Robot robot;
JFrame frame = new JFrame("Test Frame");
JTextField text = new JTextField();
@ -60,10 +58,6 @@ public class ConsumeNextMnemonicKeyTypedTest extends Applet {
} catch (AWTException e) {
throw new RuntimeException("Error: unable to create robot", e);
}
// 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() {
@ -76,7 +70,7 @@ public class ConsumeNextMnemonicKeyTypedTest extends Applet {
frame.setJMenuBar(bar);
frame.pack();
frame.setLocation(800, 0);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
test();

@ -1,46 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6396785
@summary Action key pressed on a button should be swallowed.
@author anton.tarasov@...: area=awt.focus
@library ../../../regtesthelpers
@build Util
@run applet ButtonActionKeyTest.html
-->
<head>
<title>ButtonActionKeyTest</title>
</head>
<body>
<h1>ButtonActionKeyTest<br>Bug ID: 6396785</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=ButtonActionKeyTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,22 +22,22 @@
*/
/*
test
@bug 6396785
@summary Action key pressed on a button should be swallowed.
@author anton.tarasov@...: area=awt.focus
@run applet ButtonActionKeyTest.html
@test
@key headful
@bug 6396785
@summary Action key pressed on a button should be swallowed.
@library ../../../regtesthelpers
@build Util
@run main ButtonActionKeyTest
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class ButtonActionKeyTest extends Applet {
public class ButtonActionKeyTest {
Robot robot;
JFrame frame = new JFrame("Frame");
JButton button = new JButton("button");
@ -52,11 +52,6 @@ public class ButtonActionKeyTest extends Applet {
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() {
@ -84,7 +79,7 @@ public class ButtonActionKeyTest extends Applet {
}
}
});
frame.setLocationRelativeTo(null);
frame.setVisible(true);
Util.waitForIdle(robot);

@ -1,46 +0,0 @@
<!--
Copyright (c) 2006, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6396785
@summary MenuItem activated with space should swallow this space.
@author anton.tarasov@...: area=awt.focus
@library ../../../regtesthelpers
@build Util
@run applet MenuItemActivatedTest.html
-->
<head>
<title>MenuItemActivatedTest</title>
</head>
<body>
<h1>MenuItemActivatedTest<br>Bug ID: 6396785</h1>
<p>See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE=MenuItemActivatedTest.class WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,22 +22,22 @@
*/
/*
test
@bug 6396785
@summary MenuItem activated with space should swallow this space.
@author anton.tarasov@...: area=awt.focus
@run applet MenuItemActivatedTest.html
@test
@key headful
@bug 6396785
@summary MenuItem activated with space should swallow this space.
@library ../../../regtesthelpers
@build Util
@run main MenuItemActivatedTest
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
public class MenuItemActivatedTest extends Applet {
public class MenuItemActivatedTest {
Robot robot;
JFrame frame = new JFrame("Test Frame");
JDialog dialog = new JDialog((Window)null, "Test Dialog", Dialog.ModalityType.DOCUMENT_MODAL);
@ -55,11 +55,6 @@ public class MenuItemActivatedTest extends Applet {
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() {
@ -68,6 +63,7 @@ public class MenuItemActivatedTest extends Applet {
bar.add(menu);
frame.setJMenuBar(bar);
frame.pack();
frame.setLocationRelativeTo(null);
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {

@ -1,48 +0,0 @@
<!--
Copyright (c) 2003, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 4799136
@summary Tests that type-ahead for dialog works and doesn't block program
@author area=awt.focus
@library ../../regtesthelpers
@modules java.desktop/sun.awt
@build Util
@run applet TestDialogTypeAhead.html
-->
<head>
<title> </title>
</head>
<body>
<h1>TestDialogTypeAhead<br>Bug ID: 4799136 Tests that type-ahead for dialog works and doesn't block program </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="TestDialogTypeAhead.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,51 +22,21 @@
*/
/*
test
@bug 4799136
@summary Tests that type-ahead for dialog works and doesn't block program
@author area=awt.focus
@run applet TestDialogTypeAhead.html
@test
@key headful
@bug 4799136
@summary Tests that type-ahead for dialog works and doesn't block program
@library ../../regtesthelpers
@modules java.desktop/sun.awt
@build Util
@run main TestDialogTypeAhead
*/
// Note there is no @ in front of test above. This is so that the
// harness will not mistake this file as a test file. It should
// only see the html file as a test file. (the harness runs all
// valid test files, so it would run this test twice if this file
// were valid as well as the html file.)
// Also, note the area= after Your Name in the author tag. Here, you
// should put which functional area the test falls in. See the
// AWT-core home page -> test areas and/or -> AWT team for a list of
// areas.
// Note also the 'TestDialogTypeAhead.html' in the run tag. This should
// be changed to the name of the test.
/**
* TestDialogTypeAhead.java
*
* summary:
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util;
//Automated tests should run as applet tests if possible because they
// get their environments cleaned up, including AWT threads, any
// test created threads, and any system resources used by the test
// such as file descriptors. (This is normally not a problem as
// main tests usually run in a separate VM, however on some platforms
// such as the Mac, separate VMs are not possible and non-applet
// tests will cause problems). Also, you don't have to worry about
// synchronisation stuff in Applet tests they way you do in main
// tests...
public class TestDialogTypeAhead extends Applet
{
public class TestDialogTypeAhead {
//Declare things used in the test, like buttons and labels here
static Frame f;
static Button b;
@ -76,12 +46,15 @@ public class TestDialogTypeAhead extends Applet
static Semaphore robotSema = new Semaphore();
static volatile boolean gotFocus = false;
static Robot robot;
public static void main(final String[] args) {
TestDialogTypeAhead app = new TestDialogTypeAhead();
app.init();
app.start();
}
public void init()
{
//Create instructions for the user here, as well as set up
// the environment -- set the layout manager, add buttons,
// etc.
Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
public void eventDispatched(AWTEvent e) {
System.err.println(e.toString());
@ -90,8 +63,6 @@ public class TestDialogTypeAhead extends Applet
KeyboardFocusManager.setCurrentKeyboardFocusManager(new TestKFM());
this.setLayout (new BorderLayout ());
f = new Frame("frame");
b = new Button("press");
d = new Dialog(f, "dialog", true);
@ -139,16 +110,12 @@ public class TestDialogTypeAhead extends Applet
public void start ()
{
//Get things going. Request focus, set size, et cetera
setSize (200,200);
setVisible(true);
validate();
try {
robot = new Robot();
} catch (Exception e) {
throw new RuntimeException("Can't create robot:" + e);
}
f.setLocationRelativeTo(null);
f.setVisible(true);
waitTillShown(b);
System.err.println("b is shown");

@ -1,46 +0,0 @@
<html>
<!--
Copyright (c) 2013, 2018, 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.
-->
<!--
@test
@key headful
@bug 6299858
@summary PIT. Focused border not shown on List if selected item is removed, XToolkit
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@library /test/lib
@build jdk.test.lib.Platform
@run applet FirstItemRemoveTest.html
-->
<head>
<title> </title>
</head>
<body>
<h1>FirstItemRemoveTest<br>Bug ID: 6299858 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="FirstItemRemoveTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,24 +22,31 @@
*/
/*
test
@bug 6299858 7124338
@test
@key headful
@bug 6299858
@summary PIT. Focused border not shown on List if selected item is removed, XToolkit
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@run applet FirstItemRemoveTest.html
@library /test/lib
@build jdk.test.lib.Platform
@run main FirstItemRemoveTest
*/
import jdk.test.lib.Platform;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class FirstItemRemoveTest extends Applet
public class FirstItemRemoveTest extends Frame
{
List list = new List(4, false);
Panel panel = new Panel();
public static void main(final String[] args) {
FirstItemRemoveTest app = new FirstItemRemoveTest();
app.init();
app.start();
}
public void init()
{
list.add("000");
@ -59,6 +66,8 @@ public class FirstItemRemoveTest extends Applet
public void start ()
{
setSize (200,200);
setUndecorated(true);
setLocationRelativeTo(null);
setVisible(true);
validate();

@ -1,48 +0,0 @@
<!--
Copyright (c) 2007, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6387275
@summary List: the focus is at the top of the first item, XAWT
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@requires (os.family == "linux" | os.family == "solaris")
@modules java.desktop/sun.awt
java.desktop/java.awt.peer
java.desktop/sun.awt.X11:open
@run applet FocusEmptyListTest.html
-->
<head>
<title> FocusEmptyListTest </title>
</head>
<body>
<h1>FocusEmptyListTest<br>Bug ID: 6387275 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="FocusEmptyListTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, 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
@ -22,25 +22,29 @@
*/
/*
test
@test
@key headful
@bug 6387275
@summary List: the focus is at the top of the first item, XAWT
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@run applet FocusEmptyListTest.html
@requires (os.family == "linux" | os.family == "solaris")
@modules java.desktop/sun.awt
java.desktop/java.awt.peer
java.desktop/sun.awt.X11:open
@run main FocusEmptyListTest
*/
import java.applet.Applet;
import java.awt.*;
import java.lang.reflect.*;
import java.awt.peer.ListPeer;
import sun.awt.AWTAccessor;
public class FocusEmptyListTest extends Applet {
public class FocusEmptyListTest extends Frame {
public void init() {
setLayout(new BorderLayout());
}//End init()
public static void main(final String[] args) {
FocusEmptyListTest app = new FocusEmptyListTest();
app.start();
}
public void start() {
boolean isXToolkit = Toolkit.getDefaultToolkit()
@ -61,6 +65,8 @@ public class FocusEmptyListTest extends Applet {
list.add("item1");
setSize(200, 200);
setUndecorated(true);
setLocationRelativeTo(null);
setVisible(true);
validate();

@ -1,47 +0,0 @@
<!--
Copyright (c) 2005, 2018, 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.
-->
<html>
<!--
@test
@key headful
@bug 6190768 6190778
@summary Tests that triggering events on AWT list by pressing CTRL + HOME, CTRL + END, PG-UP, PG-DOWN similar Motif behavior
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@library /test/lib
@build jdk.test.lib.Platform
@run applet KeyEventsTest.html
-->
<head>
<title> </title>
</head>
<body>
<h1>KeyEventsTest<br>Bug ID: 6190768 6190778 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="KeyEventsTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -22,30 +22,23 @@
*/
/*
test
@test
@key headful
@bug 6190768 6190778
@summary Tests that triggering events on AWT list by pressing CTRL + HOME, CTRL + END, PG-UP, PG-DOWN similar Motif behavior
@author Dmitry.Cherepanov@SUN.COM area=awt.list
@summary Tests that triggering events on AWT list by pressing CTRL + HOME,
CTRL + END, PG-UP, PG-DOWN similar Motif behavior
@library /test/lib
@build jdk.test.lib.Platform
@run applet KeyEventsTest.html
@run main KeyEventsTest
*/
/**
* KeyEventsTest.html
*
* summary:
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.util.Set;
import java.lang.reflect.*;
import jdk.test.lib.Platform;
public class KeyEventsTest extends Applet implements ItemListener, FocusListener, KeyListener
public class KeyEventsTest extends Frame implements ItemListener, FocusListener, KeyListener
{
TestState currentState;
final Object LOCK = new Object();
@ -57,6 +50,12 @@ public class KeyEventsTest extends Applet implements ItemListener, FocusListener
Panel p1 = new Panel ();
Panel p2 = new Panel ();
public static void main(final String[] args) {
KeyEventsTest app = new KeyEventsTest();
app.init();
app.start();
}
public void init()
{
setLayout (new BorderLayout ());
@ -100,11 +99,13 @@ public class KeyEventsTest extends Applet implements ItemListener, FocusListener
try{
setSize (200,200);
setVisible(true);
validate();
setUndecorated(true);
setLocationRelativeTo(null);
setVisible(true);
main(null);
doTest();
System.out.println("Test passed.");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("The test failed.");
@ -112,14 +113,6 @@ public class KeyEventsTest extends Applet implements ItemListener, FocusListener
}// start()
private void main(String[] args)
throws InterruptedException, InvocationTargetException {
doTest();
System.out.println("Test passed.");
}
public void itemStateChanged (ItemEvent ie) {
System.out.println("itemStateChanged-"+ie);
this.currentState.setAction(true);

@ -1,46 +0,0 @@
<!--
Copyright (c) 2005, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 5039416 6404008
@summary REGRESSION: Extra mouse click dispatched after press-drag- release sequence.
@library ../../regtesthelpers
@build Util
@author andrei.dmitriev area=awt.event
@run applet ExtraMouseClick.html
-->
<head>
<title>ExtraMouseClick </title>
</head>
<body>
<h1>ExtraMouseClick<br>Bug ID: 5039416 </h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="ExtraMouseClick.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, 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
@ -22,18 +22,16 @@
*/
/*
test
@bug 5039416 6404008 7087869
@test
@key headful
@bug 5039416 6404008
@summary REGRESSION: Extra mouse click dispatched after press-drag- release sequence.
@library ../../regtesthelpers
@build Util
@author andrei.dmitriev area=awt.event
@run applet ExtraMouseClick.html
@run main ExtraMouseClick
*/
import java.applet.Applet;
import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.Point;
import java.awt.Robot;
@ -50,9 +48,7 @@ import test.java.awt.regtesthelpers.Util;
// Note that this test may not fail easily. But it must always pass on
// patched workspace.
//**
public class ExtraMouseClick extends Applet
{
public class ExtraMouseClick {
Frame frame = new Frame("Extra Click After MouseDrag");
final int TRIALS = 10;
final int SMUDGE_WIDTH = 4;
@ -64,10 +60,14 @@ public class ExtraMouseClick extends Applet
boolean pressed = false;
boolean released = false;
public static void main(final String[] args) {
ExtraMouseClick app = new ExtraMouseClick();
app.init();
app.start();
}
public void init()
{
this.setLayout (new BorderLayout ());
frame.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
System.out.println("MousePressed");
@ -99,6 +99,7 @@ public class ExtraMouseClick extends Applet
public void start ()
{
frame.setSize(480, 300);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
try{
robot = new Robot();

@ -1,47 +0,0 @@
<!--
Copyright (c) 2002, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 4664415
@summary Test that double clicking the titlebar does not send RELEASE/CLICKED
@library ../../regtesthelpers
@build Util
@author bchristi: area=Mouse
@run applet TitleBarDoubleClick.html
-->
<head>
<title> </title>
</head>
<body>
<h1>TitleBarDoubleClick<br>Bug ID: 9999999 XXX_CHANGE_THIS </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="TitleBarDoubleClick.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2018, 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
@ -22,18 +22,20 @@
*/
/*
test
@test
@key headful
@bug 4664415
@summary REGRESSION: double click jframe titlebar generating mouse events in panel
@author Andrei Dmitriev: area=awt.mouse
@run applet TitleBarDoubleClick.html
@summary Test that double clicking the titlebar does not send RELEASE/CLICKED
@library ../../regtesthelpers
@build Util
@run main TitleBarDoubleClick
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import test.java.awt.regtesthelpers.Util;
public class TitleBarDoubleClick extends Applet implements MouseListener,
public class TitleBarDoubleClick implements MouseListener,
WindowListener
{
//Declare things used in the test, like buttons and labels here
@ -43,24 +45,13 @@ public class TitleBarDoubleClick extends Applet implements MouseListener,
Frame frame;
Robot robot;
public void init()
{
this.setLayout (new BorderLayout ());
}//End init()
public static void main(final String[] args) {
TitleBarDoubleClick app = new TitleBarDoubleClick();
app.start();
}
public void start ()
{
//Get things going. Request focus, set size, et cetera
setSize (200,200);
setVisible(true);
validate();
//What would normally go into main() will probably go here.
//Use System.out.println for diagnostic messages that you want
//to read after the test is done.
//Use Sysout.println for messages you want the tester to read.
robot = Util.createRobot();
robot.setAutoDelay(100);
robot.mouseMove(BOUNDS.x + (BOUNDS.width / 2),

@ -1,48 +0,0 @@
<!--
Copyright (c) 2005, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 4868278
@summary Tests that GraphicsConfig for invisible (peerless) windows is
updated after showing the window
@author artem.ananiev, area=awt.multiscreen
@library ../../regtesthelpers
@build Util
@run applet WindowGCChangeTest.html
-->
<head>
<title> WindowGCChangeTest </title>
</head>
<body>
<h1>WindowGCChangeTest<br>Bug ID: 4868278 Problem with Action button tooltips with some multiple monitor configurations </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="WindowGCChangeTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, 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
@ -22,31 +22,24 @@
*/
/*
test
@test
@key headful
@bug 4868278
@summary Tests that GraphicsConfig for invisible (peerless) window is
updated after showing the window
@author artem.ananiev, area=awt.multiscreen
@summary Tests that GraphicsConfig for invisible (peerless) windows is
updated after showing the window
@library ../../regtesthelpers
@build Util
@run applet WindowGCChangeTest.html
@run main WindowGCChangeTest
*/
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import test.java.awt.regtesthelpers.Util;
public class WindowGCChangeTest extends Applet
{
public void init()
{
}
public class WindowGCChangeTest {
public void start()
{
public static void main(final String[] args) {
Robot robot = null;
try
{
@ -57,10 +50,6 @@ public class WindowGCChangeTest extends Applet
z.printStackTrace(System.err);
throw new RuntimeException("Test FAILED: couldn't create Robot instance", z);
}
setSize(200, 200);
setVisible(true);
validate();
Util.waitForIdle(robot);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

@ -1,24 +0,0 @@
<html>
<!--
@test
@key headful
@bug 6260648
@summary Tests that WINDOW_DESTROY event can be handled by overriding handleEvent(). Also,
tests that handleEvent() is not called by AWT if any listener is added to the component
(i. e. when post-1.1 events schema is used)
@author artem.ananiev: area=awt.event
@run applet HandleWindowDestroyTest.html
-->
<head>
<title> </title>
</head>
<body>
<h1>HandleWindowDestroyTest<br>Bug ID: 6260648</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="HandleWindowDestroyTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2018, 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
@ -24,30 +24,23 @@
*/
/*
test
@test
@key headful
@bug 6260648
@summary Tests that WINDOW_DESTROY event can be handled by overriding handleEvent(). Also,
tests that handleEvent() is not called by AWT if any listener is added to the component
(i. e. when post-1.1 events schema is used)
@author artem.ananiev: area=awt.event
@run applet HandleWindowDestroyTest.html
@run main HandleWindowDestroyTest
*/
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class HandleWindowDestroyTest extends Applet
{
private volatile boolean handleEventCalled;
public class HandleWindowDestroyTest {
public void start ()
{
setSize (200,200);
setVisible(true);
validate();
private static volatile boolean handleEventCalled;
public static void main(final String[] args) {
Robot robot;
try {
robot = new Robot();

@ -1,49 +0,0 @@
<!--
Copyright (c) 2009, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 5098433
@summary REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
@author Denis Fokin: area=dnd
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@build Util
@build ProcessResults ProcessCommunicator
@run applet/othervm DragUnicodeBetweenJVMTest.html
-->
<head>
<title> REG: DnD of File-List between JVM is broken for non ASCII file names - Win32</title>
</head>
<body>
<h1> DragUnicodeBetweenJVMTest <br>Bug ID: 5098433 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="DragUnicodeBetweenJVMTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2018, 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
@ -22,43 +22,26 @@
*/
/*
test
@test
@key headful
@bug 5098433
@summary REG: DnD of File-List between JVM is broken for non ASCII file names - Win32
@author Denis Fokin: area=dnd
@library ../../regtesthelpers
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@build Util
@build ProcessResults ProcessCommunicator
@run applet/othervm DragUnicodeBetweenJVMTest.html
@run main/othervm DragUnicodeBetweenJVMTest main
*/
/**
* DragUnicodeBetweenJVMTest.java
*
* summary: The test drags a list of files (DataFlavor.javaFileListFlavor) from one jvm to another.
* The files have Unicode names. The list on target side must be equal to
* the list on the source side.
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import test.java.awt.regtesthelpers.process.ProcessCommunicator;
import test.java.awt.regtesthelpers.process.ProcessResults;
import test.java.awt.regtesthelpers.Util;
import static java.lang.Thread.sleep;
public class DragUnicodeBetweenJVMTest extends Applet
{
public void init() {
setLayout(new BorderLayout());
}//End init()
public class DragUnicodeBetweenJVMTest {
public void start() {
@ -176,7 +159,11 @@ public class DragUnicodeBetweenJVMTest extends Applet
}
}
public static void main (String [] args) {
public static void main(final String [] args) {
if (args.length > 0 && args[0].equals("main")) {
new DragUnicodeBetweenJVMTest().start();
return;
}
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args),
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args));
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args),
@ -188,6 +175,4 @@ public class DragUnicodeBetweenJVMTest extends Applet
e.printStackTrace();
}
}
}

@ -1,51 +0,0 @@
<!--
Copyright (c) 2013, 2018, 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.
-->
<html>
<!--
@test
@key headful
@bug 8005932 8017456
@summary Java 7 on mac os x only provides text clipboard formats
@author mikhail.cherkasov@oracle.com
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@library /test/lib
@build Util
@build ProcessResults ProcessCommunicator
@build jdk.test.lib.Platform
@run applet/othervm MissedHtmlAndRtfBug.html
-->
<head>
<title>Java 7 on mac os x only provides text clipboard formats</title>
</head>
<body>
<h1> MissedHtmlAndRtfBug <br>Bug ID: 8005932 </h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="MissedHtmlAndRtfBug.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -24,7 +24,6 @@
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.event.*;
import java.applet.Applet;
import java.io.File;
import java.util.ArrayList;
@ -35,11 +34,20 @@ import test.java.awt.regtesthelpers.Util;
import static java.lang.Thread.sleep;
public class MissedHtmlAndRtfBug extends Applet {
public void init() {
setLayout(new BorderLayout());
}//End init()
/*
@test
@key headful
@bug 8005932 8017456
@summary Java 7 on mac os x only provides text clipboard formats
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@library /test/lib
@build Util
@build ProcessResults ProcessCommunicator
@build jdk.test.lib.Platform
@run main/othervm MissedHtmlAndRtfBug main
*/
public class MissedHtmlAndRtfBug {
public void start() {
if (!Platform.isOSX() && !Platform.isWindows()) {
@ -178,6 +186,11 @@ public class MissedHtmlAndRtfBug extends Applet {
}
public static void main(String[] args) throws InterruptedException {
if (args.length > 0 && args[0].equals("main")) {
new MissedHtmlAndRtfBug().start();
return;
}
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extractInt(args),
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extractInt(args));
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extractInt(args),

@ -1,49 +0,0 @@
<!--
Copyright (c) 2014, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 6887703
@summary Unsigned applet can retrieve the dragged information before drop action occurs
@author : area=dnd
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@build Util
@build ProcessResults ProcessCommunicator
@run applet/othervm DragInterceptorAppletTest.html
-->
<head>
<title> Unsigned applet can retrieve the dragged information before drop action occurs </title>
</head>
<body>
<h1>DragInterceptorAppletTest<br>Bug ID: 6887703</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="DragInterceptorAppletTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, 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
@ -22,33 +22,28 @@
*/
/*
test
@test
@key headful
@bug 6887703
@summary Unsigned applet can retrieve the dragged information before drop action occurs
@author : area=dnd
@run applet DragInterceptorAppletTest.html
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@build Util
@build ProcessResults ProcessCommunicator
@run main/othervm DragInterceptorAppletTest main
*/
/**
* DragInterceptorAppletTest.java
*
* summary: Unsigned applet can retrieve the dragged information before drop action occurs
*/
import java.awt.Point;
import java.awt.Robot;
import java.awt.event.InputEvent;
import test.java.awt.regtesthelpers.Util;
import test.java.awt.regtesthelpers.process.ProcessCommunicator;
import test.java.awt.regtesthelpers.process.ProcessResults;
import static java.lang.Thread.sleep;
import test.java.awt.regtesthelpers.process.ProcessCommunicator;
import test.java.awt.regtesthelpers.process.ProcessResults;
import test.java.awt.regtesthelpers.Util;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.InputEvent;
public class DragInterceptorAppletTest extends Applet {
public void init() {
setLayout(new BorderLayout());
}//End init()
public class DragInterceptorAppletTest {
public void start() {
@ -138,7 +133,11 @@ public class DragInterceptorAppletTest extends Applet {
}
}
public static void main (String [] args) {
public static void main(final String[] args) {
if (args.length > 0 && args[0].equals("main")) {
new DragInterceptorAppletTest().start();
return;
}
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args),
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args));
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args),

@ -1,49 +0,0 @@
<!--
Copyright (c) 2007, 2016, 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.
-->
<html>
<!--
@test
@key headful
@bug 5079469
@summary DnD of File-List across JVM adds two empty items to the list
@author : area=dnd
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@build Util
@build ProcessResults ProcessCommunicator
@run applet/othervm FileListBetweenJVMsTest.html
-->
<head>
<title> DnD of File-List across JVM </title>
</head>
<body>
<h1>FileListBetweenJVMsTest<br>Bug ID: 5079469</h1>
<p> This is an AUTOMATIC test, simply wait for completion </p>
<APPLET CODE="FileListBetweenJVMsTest.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2018, 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
@ -22,39 +22,30 @@
*/
/*
test
@test
@key headful
@bug 5079469
@summary DnD of File-List across JVM adds two empty items to the list
@author : area=dnd
@run applet FileListBetweenJVMsTest.html
@library ../../regtesthelpers
@library ../../regtesthelpers/process
@build Util
@build ProcessResults ProcessCommunicator
@run main/othervm FileListBetweenJVMsTest main
*/
/**
* FileListBetweenJVMsTest.java
*
* summary: DnD of File-List across JVM adds two empty items to the list
*/
import static java.lang.Thread.sleep;
import test.java.awt.regtesthelpers.process.ProcessCommunicator;
import test.java.awt.regtesthelpers.process.ProcessResults;
import test.java.awt.regtesthelpers.Util;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.InputEvent;
import java.io.*;
public class FileListBetweenJVMsTest extends Applet {
public class FileListBetweenJVMsTest {
// information related to the test in common
static int VISIBLE_RAWS_IN_LIST=15;
public void init() {
setLayout(new BorderLayout());
}//End init()
public void start() {
SourceFileListFrame sourceFrame = new SourceFileListFrame();
@ -130,7 +121,11 @@ public class FileListBetweenJVMsTest extends Applet {
}
}
public static void main (String [] args) {
public static void main(final String [] args) {
if (args.length > 0 && args[0].equals("main")) {
new FileListBetweenJVMsTest().start();
return;
}
Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args),
InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args));
Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args),

@ -1,44 +0,0 @@
<!--
Copyright (c) 2009, 2016, 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.
-->
<html>
<!--
@test %W% %E%
@key headful
@bug 4874070
@summary Tests basic DnD functionality
@author Your Name: Alexey Utkin area=dnd
@run applet ImageDecoratedDnDInOut.html
-->
<head>
<title> ImageDecoratedDnDInOut </title>
</head>
<body>
<h1>ImageDecoratedDnDInOut<br>Bug ID: 4874070</h1>
<p> See the dialog box (usually in upper left corner) for instructions</p>
<APPLET CODE="ImageDecoratedDnDInOut.class" WIDTH=200 HEIGHT=200></APPLET>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More