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
0 answers

How to get a better way of scanning your screen

I'm looking for a better and "deeper" method of scanning my screen for certain images. In my case I am automating online processes and the current method I have for scanning my screen and looking for the "box" is this private boolean boxChecker() { …
0
votes
1 answer

Using java Robot class

I want to write an address in the address bar of a browser as well as click on a link using java Robot class. How can I track the different objects in a certain window?
sairajgemini
  • 353
  • 1
  • 3
  • 11
0
votes
1 answer

Translating chars into keystrokes in java

I've seen similar questions about this issue, but what happens to me is a little different; I am developing a remote control application and I'm sending keystrokes to my computer. The Robot class in java only accepts VK_CODES for keystrokes, so I…
Sebastian Breit
  • 6,137
  • 1
  • 35
  • 53
0
votes
2 answers

Simulate key inputs in Java for JUnit Test

I would like to simulate a Enter key press. I tried using the robot class but it doesn't seem to work: robot = new Robot(); robot.keyPress(KeyEvent.VK_ENTER); try{Thread.sleep(50);}catch(InterruptedException…
newtothissite
  • 357
  • 2
  • 6
  • 10
0
votes
3 answers

How can I create a global Robot variable without throwing an AWTException?

I'm trying to create a global Robot variable in a Java class without throwing an AWTException. The only way that I can come up with it is by throwing the exception. The reason I need it to be global is because I need to use the same Robot variable…
estacado
  • 135
  • 1
  • 2
  • 5
0
votes
1 answer

How to use robot class

I have a sort of animation going on in which a rectangle is increasing and decreasing in size........what i want to do here is detect the color of a particular location through Robot() class but its not happening..........why?? I also want to know…
Suraj Pandey
  • 31
  • 1
  • 7
0
votes
1 answer

Java Robot Class KeyPress

The code Robot r=new Robot(); r.keyPress(KeyEvent.VK_CAPS_LOCK); r.keyPress(KeyEvent.VK_V); r.keyPress(KeyEvent.VK_CAPS_LOCK); does not close after printing the V. How do I fix this?
Renish Khunt
  • 5,620
  • 18
  • 55
  • 92
0
votes
1 answer

Java RGB Value code Robot Class

I have my code up to here: package RGBValues; import java.awt.Color; import java.awt.MouseInfo; import java.awt.Point; import java.awt.PointerInfo; import java.awt.Robot; public class RGBValues { public static void main(String[] args) throws…
User
  • 31
  • 2
  • 3
  • 5
0
votes
1 answer

Java Robot class keyPress not typing into google chrome

I'm trying to beat the game 'fastTyper 2' (basically just a typing game where you type words that appear as fast as possible) by using the java robot class to type in the letters for me. I've successfully taken in the letters to be typed. However,…
Ken Katagiri
  • 195
  • 1
  • 8
0
votes
1 answer

Weird behavior of VirtualKey codes in java

I am getting keyboard input from a phone, and trying to display that on the computer using the robot class. Since I get ascii from the phone, I have a hashmap for ascii to VirtualKey value conversions. But my current code has some weird behavior.…
crypto9294
  • 171
  • 2
  • 14
0
votes
1 answer

java.awt.Robot is not functioning as expected

I have the following code: autoPlay = new Robot(); autoPlay.setAutoDelay(500); autoPlay.mouseMove((game.getLocationOnScreen().x + 1), (game.getLocationOnScreen().y +…
shdw
  • 87
  • 1
  • 11
0
votes
1 answer

Java Robot() screenCapture

I am trying to take a screenshot in minecraft (binded to F2), convert it to base64, then send it to my website, but none of my screenshots are returning an image, but the dimensions are there, here is an example…
MRVDOG
  • 1,717
  • 2
  • 13
  • 20
0
votes
1 answer

Add a KeyListener to a Thread

I created a program that using the Robot class to output some text on my notepad. public class Main extends Thread implements KeyListener { public Main() { addKeyListener(this); ... } I would like to stop it by clicking on a certain…
Imri Persiado
  • 1,857
  • 8
  • 29
  • 45
0
votes
2 answers

make screenshot

i want to make a screenshot of the panel that i have created and the code is given below. Can any body please tell me why i am not getting.thanks public static final void makeScreenshot(JFrame argFrame) { Rectangle rec =…
user2045376
0
votes
2 answers

How to set focus to a window in java.awt.Robot

I am using selenium web driver to automate my web application. I am using java.awt.robot class to take screenshots. When i run my test it will open the browser and it will perform as i need and it will take the screenshot of the front window on the…
Manigandan
  • 5,004
  • 1
  • 28
  • 47