< prev index next >
test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java
Print this page
@@ -26,22 +26,18 @@
@key headful
@bug 6492970
@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");
Dialog dialog1 = new Dialog(nofocusFrame, "Owned Dialog", false);
Dialog dialog2 = new Dialog((Frame)null, "Owned Dialog", false);
@@ -74,10 +70,11 @@
}
});
nofocusFrame.add(showButton);
nofocusFrame.pack();
nofocusFrame.setFocusableWindowState(false);
+ nofocusFrame.setLocation(200, 200);
nofocusFrame.setVisible(true);
Util.waitForIdle(robot);
robot.delay(3000);
@@ -95,11 +92,11 @@
}
private void test(Window toplevel, int stage) {
toplevel.add(testButton);
toplevel.pack();
- toplevel.setLocation(200, 0);
+ toplevel.setLocation(400, 200);
switch (stage) {
case 1:
toplevel.setVisible(true);
break;
< prev index next >