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

Keyboard/Mouse Robot not working when focused on a certain application

So I am trying to use a robot (either keypress or mouse) to simulate some tests on an application. However, this program isn't allowing me to do so and I'm pretty sure it is a security feature. The application I am using is TEMS Investigation and I…
Ducksauce88
  • 640
  • 3
  • 12
  • 26
0
votes
2 answers

Asynchronously taking screenshots in Java in different threads?

I have a few threads running, which are all required to constantly take pictures of different areas of screen. Each thread has its own instance of Robot. The problem is, rather than the shots being taken asynchronously by each thread, they seem to…
Ali
  • 261,656
  • 265
  • 575
  • 769
0
votes
3 answers

Starting/stopping a program with a JButton (Java)

So I have created a program which does the intended purpose of sending random keystrokes. Now I have implemented a very basic GUI with a Start/Stop button. The program is meant to run when the integer "running" is equal to 1. So I decided to make…
user2872275
0
votes
1 answer

How to Type URL using Robot class in Java

I want to create program which can type automatically using following methods: robot.keyPress(code); robot.keyRelease(code); but i can not press Any Special Characters, It throws Exception like: Exception in thread "main"…
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
0
votes
0 answers

Capturing the screen quickly

So I'm working on a screen recording program and what I do is take screen shots while the program is running and then convert it to a .mov file. TO take a screen shot what I'm doing is do { try { r = new Robot(); img =…
user2612619
  • 1,119
  • 3
  • 11
  • 28
0
votes
3 answers

Reformatting a list to add " " and ,

I have a list like this but much longer in a text document. 123451234 1234123 1234567 12345678 I need it to be reformatted to "1123451234", "1234123","1234567","123123123","112345678" I have tried the robot class with java in a loop. I can add…
SolidCloudinc
  • 329
  • 10
  • 27
0
votes
2 answers

Java auto typer with robot class?

Hi i was wondering if there is a way i can make an auto typer by using the robot class? Is there a way i could make a string into char[] and type out each letter? anyway i could use a case for each letter (Example below). case ' ': key =…
WillBaker
  • 33
  • 1
  • 6
0
votes
1 answer

Java - get click off the limits of JPanel

I have the following doubt: Is it possible to get a "mouse left click event" off the limits of the component with a mouselistener? Or should i try this with another approach? My problem is the following. I am creating a WYSIWYG panel that is…
pcezar91
  • 111
  • 11
0
votes
1 answer

KeyListener and boolean not working

import java.awt.Robot; import java.awt.event.KeyEvent; public class Main { static boolean check = false; static boolean boom = true; public static void main(String[] args) throws Exception{ do{ if(check == true){ …
ESipalis
  • 381
  • 4
  • 17
0
votes
3 answers

Invalid key code @ java

I'm working on a system to type things automatically with java. This is how I write it: public void typeMessage(String message) { for (char c : message.toCharArray()) { int code = c; if (code > 96 && code < 123) code…
Tyluur
  • 95
  • 2
  • 10
0
votes
1 answer

How to make java robot class type apostrophe '

I am having problems making the method keyPress from the java robot class press the apostrophe key. I am looking for something like: Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_APOSTROPHE); Thanks.
Kiwi Bird
  • 145
  • 1
  • 2
  • 9
0
votes
1 answer

rookie issue: AWTException cannot be resolved to a type

I'm sorry for asking what is probably a very simple question, but my google-fu skills are failing me here. All I want to do is have a simple robot click around and type stuff. here is the whole of my class thus far: import java.awt.Robot; public…
0
votes
1 answer

Robot screen capture - heap OutOfMemory while resizing

I am using Robot's screenCapture method which returns BufferedImage, and then send using Socket to client on Android. If I don't reduce Quality then It works fine but it is very slow as Image is large and takes much time to send. I am trying to…
fzkhan
  • 121
  • 3
  • 16
0
votes
2 answers

class not getting instantiated, doesn't work using actionlistener, works fine separately

I am trying to make a screen capturing program. What I have is a transparent window, which will give the area to be captured, with a button capture on it, and I am trying to instantiate a class captureScreen that works good when is individually…
Optimus Prime
  • 6,817
  • 5
  • 32
  • 60
0
votes
3 answers

Java impassable region

I have a mouse event handler and under mouseMoved I have this: public void mouseMoved(MouseEvent e) { if((e.getX()>=0 && e.getX()<=100) && (e.getY()>=0 && e.getY()<=100)) { robot.mouseMove(mainOutput.getX()+200,mainOutput.getY()+200); …
SelfDeceit
  • 107
  • 1
  • 2
  • 13