Questions tagged [awtrobot]

The Robot class (java.awt.Robot) is used to programmatically trigger input events such as key press events and mouse actions & can also perform screenshot capture.

The Robot class (java.awt.Robot) is used to programmatically trigger input events, such as key press events and mouse actions & can also perform capture.

For Example:

Example of Java Robot Programming

662 questions
0
votes
1 answer

Why doesn't CTRL+C (simulated with Awt.Robot) work properly?

I have read a web page frame from a browser with a following routine and gain all time a same result (first time copied part of the page): Move a mouse to a frame Select a text with a triple click Copy text with simulated CTRL+C keyboard press…
Yehor Nemov
  • 907
  • 2
  • 16
  • 31
0
votes
2 answers

Java input method for Virtual Keyboard

I am facing a problem in implementing Input method for Virtual Keyboard. Currently I am using robot class for sending input to any application from virtual keyboard. But for that I need to create mapping of key-code and unicode, which is not…
shekhar
  • 19
  • 1
  • 3
0
votes
1 answer

GUI testing library with user actions recording?

I want to make junit test for an application, with graphics editor like functionality. I.e. user can drag and drop mouse smoothly in GUI. It seems not usefull to write coordinate movements programmatically. Is it possible to have some macro…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
0
votes
1 answer

AWT ROBOT - I can't find an element

I'm creating a application with WebDriver API for make non regression tests. At a moment, I have to find an element (fic) on my computer (with the Windows's navigator), and i can't (or I just fail :P) do this with WebDriver. So I'm searching for and…
pikameuh
  • 149
  • 1
  • 1
  • 12
0
votes
2 answers

Can't type semicolon with Java Robot class

I am trying to type a semicolon using the Java Robot class but it is not functioning properly. It simply will not type anything and it causes me to highlight everything I click after the program ends. Does someone know why this is not working? Here…
user3341249
  • 73
  • 1
  • 11
0
votes
1 answer

Using Java Robot class for simulating alt+right arrow, draws signs instead of going to next page

I'm building a small Java application that has two buttons. One of the buttons should change the chrome's page to the previous one, and the second should change to the next page. I'm using Java Robot class in order to stimulate the shortcuts that…
Presen
  • 1,809
  • 4
  • 31
  • 46
0
votes
3 answers

java.awt.AWTException: headless environment at java.awt.Robot.(Robot.java:94)

I am doing screen recording application in servlet. But its working correctly in localhost with tomcat sever7x. But when I hosted in web server it shows error like this java.awt.AWTException: headless environment at…
user3607151
  • 19
  • 1
  • 2
0
votes
2 answers

Robot r cannot be resolved

public void method1 (int x) { if (x == 1) { try { Robot r = new Robot(); } catch (AWTException e) { // TODO Auto-generated catch block e.printStackTrace(); } …
user3265784
0
votes
1 answer

how to decrease the size of screenshot image in java

I am creating an application in Java to capture a screenshot at a time interval using the following code: Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); BufferedImage capture = new…
Uday A. Navapara
  • 1,237
  • 5
  • 20
  • 40
0
votes
1 answer

It seems that I can't press every button with the robot class

First off : I'm using an azerty keyboard. I want to press the button which is in the upper left corner, just below 'escape'. I believe it's the '~' for qwerty keyboard (for azerty it is '²') I unsuccesfully search for it's key code then I found this…
sliders_alpha
  • 2,276
  • 4
  • 33
  • 52
0
votes
1 answer

Simulate multiple key-press combinations

I looking for a solution where I can "press" two keys at the same time using Java or .NET. Recently I have tried below code in Java which is working perfectly fine on one key. Here is the code for one key r.keyPress(KeyEvent.VK_R); Upon execution…
user3498003
  • 21
  • 1
  • 4
0
votes
0 answers

Scan Screen to look for specific colour JAVA

i want my program to look for a colour near white and click on it. I know how to identify a colour when i point my mouse to it and my goal is to do the opposite EX. search for a colour near white then click on it public static void klick ( int x…
user1965081
  • 55
  • 1
  • 2
  • 8
0
votes
3 answers

Java if statements that has a range

Say if red = 200 and green = 190 and blue = 210 then where the mouse is my problem is that red, green and blue can change each time but they will always be close to eachother ex. red=230,blue=250,green=240 I want to create an if statement that has a…
user1965081
  • 55
  • 1
  • 2
  • 8
0
votes
1 answer

how to look for a colour and click on it (white colour keeps changing shades) Java

import java.awt.AWTException; import java.awt.Robot; import java.awt.event.MouseEvent; import java.awt.Color; public class main { private static Robot robot = null; public static void main(String[] args) { try { robot = new Robot…
user1965081
  • 55
  • 1
  • 2
  • 8
0
votes
1 answer

JAVA Robot mouse event not working on login screen of oSX mavericks but works on lower version

I run a java application in login window using LaunchAgents ,which captures mouse and keyboard events remotely and executes it. The keyboard events work properly but not the mouse events.