< prev index next >

test/jdk/java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java

Print this page

        

*** 20,48 **** * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! @test %W% %E% @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 */ 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 { 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";}}; volatile int nFocused; Robot robot; --- 20,46 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! @test @key headful @bug 6598089 @summary Tests restoring focus on a single disabled coponent @library ../../regtesthelpers @build Util @run main RestoreFocusOnDisabledComponentTest */ import java.awt.*; import java.awt.event.*; import test.java.awt.regtesthelpers.Util; /* * The bug is not reproducible on Windows. */ ! 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";}}; volatile int nFocused; Robot robot;
*** 60,70 **** public void start() { frame.add(b0); frame.add(b1); frame.setLayout(new FlowLayout()); frame.pack(); ! frame.setVisible(true); Util.waitForIdle(robot); KeyboardFocusManager.setCurrentKeyboardFocusManager(new DefaultKeyboardFocusManager() { public boolean dispatchEvent(AWTEvent e) { --- 58,68 ---- public void start() { frame.add(b0); frame.add(b1); frame.setLayout(new FlowLayout()); frame.pack(); ! frame.setLocationRelativeTo(null); frame.setVisible(true); Util.waitForIdle(robot); KeyboardFocusManager.setCurrentKeyboardFocusManager(new DefaultKeyboardFocusManager() { public boolean dispatchEvent(AWTEvent e) {
< prev index next >