mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-28 03:43:21 +00:00
8256289: java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java failed with "RuntimeException: Wrong focus owner: java.awt.Button[button1,41,36,56x23,label=Button1]"
Reviewed-by: honkar, prr, azvegint, serb
This commit is contained in:
parent
c85c5cb50e
commit
21c985f2d7
@ -808,7 +808,6 @@ java/awt/TextArea/TextAreaCursorTest/HoveringAndDraggingTest.java 8024986 macosx
|
||||
java/awt/TextComponent/CorrectTextComponentSelectionTest.java 8237220 macosx-all
|
||||
java/awt/TextComponent/SelectionAndCaretColor.java 7017622 linux-all
|
||||
java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter.java 8254841 macosx-all
|
||||
java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java 8256289 windows-x64
|
||||
java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java 8258103 linux-all
|
||||
java/awt/Focus/FrameMinimizeTest/FrameMinimizeTest.java 8016266 linux-x64
|
||||
java/awt/Frame/SizeMinimizedTest.java 8305915 linux-x64
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
@ -25,10 +25,10 @@
|
||||
@test
|
||||
@key headful
|
||||
@bug 4041703 4096228 4025223 4260929
|
||||
@summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
|
||||
@summary Ensures that reasonable default focus is set correctly on start
|
||||
@library ../../regtesthelpers
|
||||
@build Util
|
||||
@run main AppletInitialFocusTest
|
||||
@run main InitialFocusTest
|
||||
*/
|
||||
|
||||
import java.awt.Button;
|
||||
@ -37,13 +37,13 @@ import java.awt.Frame;
|
||||
import java.awt.Robot;
|
||||
import test.java.awt.regtesthelpers.Util;
|
||||
|
||||
public class AppletInitialFocusTest extends Frame {
|
||||
public class InitialFocusTest extends Frame {
|
||||
|
||||
Robot robot = Util.createRobot();
|
||||
Button button = new Button("Button");
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
AppletInitialFocusTest app = new AppletInitialFocusTest();
|
||||
InitialFocusTest app = new InitialFocusTest();
|
||||
app.init();
|
||||
app.start();
|
||||
}
|
||||
@ -63,7 +63,7 @@ public class AppletInitialFocusTest extends Frame {
|
||||
robot.delay(1000); // delay the thread to let EDT to start dispatching focus events
|
||||
Util.waitForIdle(robot);
|
||||
if (!button.hasFocus()) {
|
||||
throw new RuntimeException("Appletviewer doesn't set default focus correctly.");
|
||||
throw new RuntimeException("default focus is not set correctly.");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
@ -31,17 +31,17 @@ import java.awt.event.FocusListener;
|
||||
* @test
|
||||
* @key headful
|
||||
* @bug 4411534 4517274
|
||||
* @summary ensures that user's requestFocus() during applet initialization
|
||||
* @summary ensures that user's requestFocus() during frame initialization
|
||||
* is not ignored
|
||||
*/
|
||||
public class AppletInitialFocusTest1 extends Frame implements FocusListener {
|
||||
public class InitialFocusTest1 extends Frame implements FocusListener {
|
||||
|
||||
Button button1 = new Button("Button1");
|
||||
Button button2 = new Button("Button2");
|
||||
private static volatile Object focused;
|
||||
|
||||
public static void main(final String[] args) throws Exception {
|
||||
AppletInitialFocusTest1 app = new AppletInitialFocusTest1();
|
||||
InitialFocusTest1 app = new InitialFocusTest1();
|
||||
try {
|
||||
app.setSize(200, 200);
|
||||
app.setLocationRelativeTo(null);
|
||||
Loading…
x
Reference in New Issue
Block a user