use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.
the class bug7055065 method main.
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Robot robot = new Robot();
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowUI();
}
});
toolkit.realSync();
clickCell(robot, 1, 1);
Util.hitKeys(robot, KeyEvent.VK_BACK_SPACE, KeyEvent.VK_BACK_SPACE, KeyEvent.VK_BACK_SPACE);
toolkit.realSync();
clickColumnHeader(robot, 1);
toolkit.realSync();
clickColumnHeader(robot, 1);
}
use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.
the class bug8036819 method main.
public static void main(String[] args) throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
toolkit.realSync();
Robot robo = new Robot();
robo.setAutoDelay(300);
// Using mnemonic key to focus on the textfield
Util.hitMnemonics(robo, KeyEvent.VK_P);
toolkit.realSync();
if (!passed) {
throw new RuntimeException("Test failed.");
}
}
use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.
the class bug4247996 method main.
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Robot robot = new Robot();
robot.setAutoDelay(50);
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
toolkit.realSync();
Point point = getButtonCenter();
robot.mouseMove(point.x, point.y);
toolkit.realSync();
checkButtonsSize();
}
use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.
the class bug6777378 method main.
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
Robot robot = new Robot();
robot.setAutoDelay(20);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (Exception e) {
e.printStackTrace();
}
JTable table = new JTable(new AbstractTableModel() {
public int getRowCount() {
return 10;
}
public int getColumnCount() {
return 10;
}
public Object getValueAt(int rowIndex, int columnIndex) {
return "" + rowIndex + " " + columnIndex;
}
});
header = new JTableHeader(table.getColumnModel());
header.setToolTipText("hello");
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(header);
frame.setSize(300, 300);
frame.setVisible(true);
}
});
toolkit.realSync();
Point point = header.getLocationOnScreen();
robot.mouseMove(point.x + 20, point.y + 50);
robot.mouseMove(point.x + 30, point.y + 50);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
use of sun.awt.SunToolkit in project jdk8u_jdk by JetBrains.
the class bug6495408 method main.
public static void main(String[] args) throws Exception {
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
final Robot robot = new Robot();
robot.setAutoDelay(50);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
tabbedPane = new JTabbedPane();
tabbedPane.setTabPlacement(JTabbedPane.LEFT);
tabbedPane.addTab("Hello", null);
frame.add(tabbedPane);
frame.setSize(400, 400);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
toolkit.realSync();
final Rectangle d = new Rectangle();
final Point p = new Point();
for (int i = 0; i < 7; i++) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
int tab = tabbedPane.getTabCount() - 1;
Rectangle bounds = tabbedPane.getBoundsAt(tab);
if (bounds != null) {
d.setBounds(bounds);
p.setLocation(d.x + d.width / 2, d.y + d.height / 2);
SwingUtilities.convertPointToScreen(p, tabbedPane);
robot.mouseMove(p.x, p.y + d.height);
tabbedPane.addTab("Hello", null);
}
}
});
}
}
Aggregations