< prev index next >
test/jdk/java/awt/Focus/ModalBlockedStealsFocusTest/ModalBlockedStealsFocusTest.java
Print this page
@@ -20,42 +20,34 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
- test
+ @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
- @run applet ModalBlockedStealsFocusTest.html
+ @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.");
return;
}
< prev index next >