Search in sources :

Example 91 with SunToolkit

use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.

the class bug4220171 method main.

public static void main(String[] args) throws Exception {
    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
    Robot robot = new Robot();
    robot.setAutoDelay(50);
    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {

        public void run() {
            createAndShowGUI();
        }
    });
    toolkit.realSync();
    clickMouse(robot, 0, 0);
    Util.hitKeys(robot, KeyEvent.VK_A, KeyEvent.VK_B, KeyEvent.VK_ENTER);
    toolkit.realSync();
    checkCell(0, 0);
    clickMouse(robot, 0, 1);
    Util.hitKeys(robot, KeyEvent.VK_D, KeyEvent.VK_E, KeyEvent.VK_ENTER);
    toolkit.realSync();
    checkCell(0, 1);
    clickMouse(robot, 1, 0);
    Util.hitKeys(robot, KeyEvent.VK_1, KeyEvent.VK_2, KeyEvent.VK_ENTER);
    toolkit.realSync();
    checkCell(1, 0);
    clickMouse(robot, 1, 1);
    Util.hitKeys(robot, KeyEvent.VK_4, KeyEvent.VK_5, KeyEvent.VK_ENTER);
    toolkit.realSync();
    checkCell(1, 1);
}
Also used : SunToolkit(sun.awt.SunToolkit) Robot(java.awt.Robot)

Example 92 with SunToolkit

use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.

the class Test6968363 method main.

public static void main(String[] args) throws Exception {
    SunToolkit toolkit = (SunToolkit) getDefaultToolkit();
    Runnable task = new Test6968363();
    invokeAndWait(task);
    toolkit.realSync(100);
    new Robot().keyPress(VK_LEFT);
    toolkit.realSync(100);
    invokeAndWait(task);
}
Also used : SunToolkit(sun.awt.SunToolkit) Robot(java.awt.Robot)

Example 93 with SunToolkit

use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.

the class WrongAltProcessing method sync.

public static void sync() {
    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
    toolkit.realSync();
}
Also used : SunToolkit(sun.awt.SunToolkit)

Example 94 with SunToolkit

use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.

the class bug8023474 method main.

public static void main(String[] args) throws Exception {
    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
    Robot robot = new Robot();
    robot.setAutoDelay(50);
    SwingUtilities.invokeAndWait(new Runnable() {

        public void run() {
            createAndShowGUI();
        }
    });
    toolkit.realSync();
    Point point = getRowPointToClick(1);
    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
    toolkit.realSync();
    Boolean result = (Boolean) tree.getCellEditor().getCellEditorValue();
    if (!result) {
        throw new RuntimeException("Test Failed!");
    }
}
Also used : SunToolkit(sun.awt.SunToolkit)

Example 95 with SunToolkit

use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.

the class bug5043626 method main.

public static void main(String[] args) throws Exception {
    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
    robot = new Robot();
    SwingUtilities.invokeAndWait(new Runnable() {

        public void run() {
            createAndShowGUI();
        }
    });
    toolkit.realSync();
    Util.hitKeys(robot, KeyEvent.VK_HOME);
    Util.hitKeys(robot, KeyEvent.VK_1);
    toolkit.realSync();
    String test = getText();
    if (!"1test".equals(test)) {
        throw new RuntimeException("Begin line action set cursor inside <head> tag");
    }
    Util.hitKeys(robot, KeyEvent.VK_HOME);
    Util.hitKeys(robot, KeyEvent.VK_2);
    toolkit.realSync();
    test = getText();
    if (!"21test".equals(test)) {
        throw new RuntimeException("Begin action set cursor inside <head> tag");
    }
}
Also used : SunToolkit(sun.awt.SunToolkit) Robot(java.awt.Robot)

Aggregations

SunToolkit (sun.awt.SunToolkit)120 Robot (java.awt.Robot)26 Point (java.awt.Point)9 Frame (java.awt.Frame)7 JFrame (javax.swing.JFrame)7 BufferedImage (java.awt.image.BufferedImage)5 Rectangle (java.awt.Rectangle)4 FlowLayout (java.awt.FlowLayout)3 TextField (java.awt.TextField)3 Toolkit (java.awt.Toolkit)3 MouseEvent (java.awt.event.MouseEvent)3 JTableHeader (javax.swing.table.JTableHeader)3 Component (java.awt.Component)2 KeyEvent (java.awt.event.KeyEvent)2 VolatileImage (java.awt.image.VolatileImage)2 ByteArrayInputStream (java.io.ByteArrayInputStream)2 File (java.io.File)2 IOException (java.io.IOException)2 Field (java.lang.reflect.Field)2 URL (java.net.URL)2