test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java
equal
deleted
inserted
replaced
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 test |
25 @test |
26 @bug 6272324 |
26 @key headful |
27 @summary Modal excluded Window which decorated parent is blocked should be non-focusable. |
27 @bug 6272324 |
28 @author anton.tarasov@sun.com: area=awt.focus |
28 @summary Modal excluded Window which decorated parent is blocked should be non-focusable. |
29 @run applet NonFocusableBlockedOwnerTest.html |
29 @modules java.desktop/sun.awt |
|
30 @run main NonFocusableBlockedOwnerTest |
30 */ |
31 */ |
31 |
32 |
32 import java.applet.Applet; |
|
33 import java.awt.*; |
33 import java.awt.*; |
34 import java.awt.event.*; |
34 import java.awt.event.*; |
35 import java.lang.reflect.*; |
35 import java.lang.reflect.*; |
36 |
36 |
37 public class NonFocusableBlockedOwnerTest extends Applet { |
37 public class NonFocusableBlockedOwnerTest { |
38 Robot robot; |
38 Robot robot; |
39 Frame frame = new Frame("Modal Blocked Frame"); |
39 Frame frame = new Frame("Modal Blocked Frame"); |
40 Dialog dialog = new Dialog(frame, "Modal Dialog", true); |
40 Dialog dialog = new Dialog(frame, "Modal Dialog", true); |
41 Window excluded = new Window(frame); |
41 Window excluded = new Window(frame); |
42 Button button = new Button("button"); |
42 Button button = new Button("button"); |
51 try { |
51 try { |
52 robot = new Robot(); |
52 robot = new Robot(); |
53 } catch (AWTException e) { |
53 } catch (AWTException e) { |
54 throw new RuntimeException("Error: unable to create robot", e); |
54 throw new RuntimeException("Error: unable to create robot", e); |
55 } |
55 } |
56 // Create instructions for the user here, as well as set up |
|
57 // the environment -- set the layout manager, add buttons, |
|
58 // etc. |
|
59 this.setLayout (new BorderLayout ()); |
|
60 } |
56 } |
61 |
57 |
62 public void start() { |
58 public void start() { |
63 |
59 |
64 if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { |
60 if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { |