24 import java.awt.Robot;
25 import java.awt.Toolkit;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.KeyEvent;
28
29 import javax.swing.AbstractAction;
30 import javax.swing.InputMap;
31 import javax.swing.JFrame;
32 import javax.swing.JMenuBar;
33 import javax.swing.JMenuItem;
34 import javax.swing.KeyStroke;
35 import sun.awt.SunToolkit;
36
37 import static java.awt.event.InputEvent.CTRL_DOWN_MASK;
38 import static javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW;
39 import static javax.swing.JOptionPane.showMessageDialog;
40 import static javax.swing.SwingUtilities.invokeAndWait;
41
42 /*
43 * @test
44 * @bug 8013370
45 * @summary Ensure that key stroke is not null
46 * @author Sergey Malenkov
47 */
48
49 public class Test8013370 implements Runnable {
50 public static void main(String[] args) throws Exception {
51 Test8013370 task = new Test8013370();
52 invokeAndWait(task);
53
54 Robot robot = new Robot();
55 robot.waitForIdle();
56 robot.keyPress(KeyEvent.VK_CONTROL);
57 robot.keyRelease(KeyEvent.VK_CONTROL);
58 robot.waitForIdle();
59
60 invokeAndWait(task);
61 task.validate();
62 }
63
|
24 import java.awt.Robot;
25 import java.awt.Toolkit;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.KeyEvent;
28
29 import javax.swing.AbstractAction;
30 import javax.swing.InputMap;
31 import javax.swing.JFrame;
32 import javax.swing.JMenuBar;
33 import javax.swing.JMenuItem;
34 import javax.swing.KeyStroke;
35 import sun.awt.SunToolkit;
36
37 import static java.awt.event.InputEvent.CTRL_DOWN_MASK;
38 import static javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW;
39 import static javax.swing.JOptionPane.showMessageDialog;
40 import static javax.swing.SwingUtilities.invokeAndWait;
41
42 /*
43 * @test
44 * @key headful
45 * @bug 8013370
46 * @summary Ensure that key stroke is not null
47 * @author Sergey Malenkov
48 */
49
50 public class Test8013370 implements Runnable {
51 public static void main(String[] args) throws Exception {
52 Test8013370 task = new Test8013370();
53 invokeAndWait(task);
54
55 Robot robot = new Robot();
56 robot.waitForIdle();
57 robot.keyPress(KeyEvent.VK_CONTROL);
58 robot.keyRelease(KeyEvent.VK_CONTROL);
59 robot.waitForIdle();
60
61 invokeAndWait(task);
62 task.validate();
63 }
64
|