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
-1
votes
4 answers

Can someone tell me what I'm doing wrong to setup this Robot class in Java?

I started learning Java last week so bear with me as I'm just getting the hang of things. I'm trying to make a class that extends the Java Robot class. I am getting an "Identifier Expected" on this line: public ChanseyRobot(bot) Robot Class:…
mbridges
  • 184
  • 1
  • 2
  • 12
-1
votes
2 answers

robot types the wrong chars

I got a java robot to type characters, however it prints stuff like: .. 5./. .. .. //5 / /55/ /.. ..5.. .. 5 5 . 5. Instead of the wanted string. Does someone know how to avoid this? import java.awt.Robot; import…
clankill3r
  • 9,146
  • 20
  • 70
  • 126
-2
votes
2 answers

What does the Java Robot class do?

What function exactly does the Robot class in Java serve? Does it press keys or what?
user740005
  • 121
  • 1
  • 1
  • 4
-2
votes
1 answer

How to click mouse automatically without clicking mouse

I'm making a project in java. In this i'm using speech recognition. Now i want to click button when i speak click. I want to know how to click mouse automatically?
ritu
  • 1
  • 5
-2
votes
1 answer

The type of the expression must be an array type but it resolved to ArrayList -KeyEvent

I wrote code who will first "record" (add to arraylist some keyevent). Like I press A C D A, and after program by the for each will be press this keys. I try do it by arraylist, but it iisnt working, anyone can help me? I have "robot cannot be…
Brade
  • 17
  • 7
-2
votes
2 answers

Java loop only if checkbox is selected

private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 148, 120); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JButton btnStart = new JButton("Start"); …
Lane will
  • 75
  • 9
-2
votes
2 answers

Long Press Android to Java

I'm trying to program a Mouse via Wifi TCP. Client is on Android and Server on Java. I'm trying to detect a LongPress on Android and send this information to Java. Android: I need to implement MotionEvent.ACTION_DOWN but I don´t know what to do…
-3
votes
1 answer

AWT Robot class Issue

I'm here to talk to you about a problem I got today working for the first time whit this new class called "Robot" of the library java.awt. I must say Robot works fine, but troubles come every time i stop the application. My keyboard doesn't…
-3
votes
1 answer

How to select data from custom combo box in which select action, robot action is not working reliably using webdriver

String value = “Card77”; // value which i need to select from custom box initRobot(); // initiate robot globally driver.findElement(By.classname(“custom-combobox”)).click(); // click custom box Type.word(value); //type value in the drop to…
Trishul M
  • 1
  • 2
-3
votes
3 answers

Robot cannot be resolved to a type

I tried to make program, which moves mouse to some coordinates (x, y). I have this error: Multiple markers at this line - MoveMouse cannot be resolved My code: import java.awt.AWTException; import java.awt.Robot; public class Temr { …
Brade
  • 17
  • 7
-3
votes
1 answer

Scanning the screen in Java?

I need a short method that gives me the color of a point with given coordinates. I heard of a Robot class that can take screenshots, but I don't really know how to use it.
Aaron
  • 141
  • 6
-3
votes
3 answers

Keyboard Robot class issue

I've created Keyboard class for working with Robot. But when I starting using methods from this class I have error in logs. Here's my Keyboard.java with method pressEscape(): public class Keyboard { private static Robot robot; private…
Jason P.
  • 1
  • 3
-3
votes
1 answer

Use robot to click and type in Microsoft Word not working

I created the following code to do the following: Create a new Word file and open it Check the task manager to see if it did open and then continue Use a Robot class to move to the centre of the screen, then click on the Word application and type:…
user2138639
  • 113
  • 1
  • 2
  • 8
-3
votes
2 answers

Java program works in eclipse but in from jar

I'm writing a simple java program with the intent to break an afk limit. Whenever I run it in Eclipse, it works just fine. However, when I export it as a runnable jar file, It won't simulate key presses. I believe I have the correct run…
Zach M
  • 1
  • 1
  • 4
-3
votes
1 answer

Is there any other way of obtaining a screenshot of the entire screen? (Java)

Besides using the createScreenCapture() method of the java.awt.Robot class, is there any other way of obtaining a screenshot of the entire screen?
1 2 3
44
45