< prev index next >

test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java

Print this page

        

*** 26,47 **** @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 { 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); --- 26,43 ---- @key headful @bug 6492970 @summary Tests that showing a toplvel in a not foreground Java process activates it. @library ../../regtesthelpers @build Util @run main ShowFrameCheckForegroundTest */ import java.awt.*; import java.awt.event.*; import test.java.awt.regtesthelpers.Util; ! 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,83 **** --- 70,80 ---- } }); nofocusFrame.add(showButton); nofocusFrame.pack(); nofocusFrame.setFocusableWindowState(false); + nofocusFrame.setLocation(200, 200); nofocusFrame.setVisible(true); Util.waitForIdle(robot); robot.delay(3000);
*** 95,105 **** } private void test(Window toplevel, int stage) { toplevel.add(testButton); toplevel.pack(); ! toplevel.setLocation(200, 0); switch (stage) { case 1: toplevel.setVisible(true); break; --- 92,102 ---- } private void test(Window toplevel, int stage) { toplevel.add(testButton); toplevel.pack(); ! toplevel.setLocation(400, 200); switch (stage) { case 1: toplevel.setVisible(true); break;
< prev index next >