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

java voice command

I'm still pretty new to java and I was thinking about making a program where the computer could listen to you talking and write what you said on word or something using the java Robot. Honestly, I have no idea where to start with this and could…
0
votes
1 answer

Take a "screenshot" of 3rd party applet in my webpage

I have a third party Java applet that I am going to embed in my webpage but I don't have access to the applet code. But I want to create a button on my page on clicking which will create a screenshot of the applet (but not the whole screen). I…
0
votes
2 answers

Generate AWT keyevent for special characters

I want to generate key events for Special characters like £, €, µ, ½, Ö, Ä etc. I am able to generate keyevents for key which are on my keyboard like 'A,B,c, %, *, ^' etc with following code: public static void generateKeyEvent(final int c) { …
mudit
  • 25,306
  • 32
  • 90
  • 132
0
votes
1 answer

Robot class - Java

import java.awt.*; import java.awt.event.InputEvent; import java.awt.image.BufferedImage; public final class test { private static Robot robot; public static boolean clickStatus; public static void leftClick (int R, int G, int B) …
user1304765
  • 247
  • 3
  • 19
-1
votes
1 answer

Is there a graceful way to preserve interrupt status when it's reset by private source code?

I'm using the Robot class to perform mouse functions in my program, however I've encountered an issue with it swallowing the InterruptedException and printing the stack trace. This is not good because I need the interrupted status to be…
Greg
  • 61
  • 5
-1
votes
1 answer

why is newline(\n) behaving differently then pressing enter on Raspbian CLI

I made a application that basically reads out data and prints it out on the raspbian Command Line Interface (CLI) using system.out.print. Printing text on the CLI using the mentioned method works regarding printing text. After printing the text I…
denbrau
  • 11
  • 4
-1
votes
2 answers

A loop that would type a random character using robot.keyPress

I'm trying to write a random character using robot.keyPress. So far I've opened the notepad, wrote in it and saved it. If I run this program in a loop it would always save the notepad with the same name and therefore replacing the previous one. I…
Libraa
  • 17
  • 4
-1
votes
1 answer

How am I supposed to reduce 100 lines code to fewer? (Java robot)

So I made a javafx application that store texts and you can choose which text you want the program to type in (using for a game to set the binds) I have this: public class AutoClicker { private Robot robot; public AutoClicker() { try { …
Lkala299
  • 1
  • 1
-1
votes
1 answer

Java Robot MouseMove is inconsistent

I have this code: Robot mov = null; try { mov = new Robot(); } catch (AWTException e1) { e1.printStackTrace(); } if(movedy!=0&&movedx!=0) { mov.mouseMove(300, 300); } And on my PC, IT never moves the mouse to the correct location.…
Jamal H
  • 934
  • 7
  • 23
-1
votes
1 answer

Interaction with another java application which is an executable jar file

I'm writing a java application, but I need to launch another java application which is just a JAR file (I do not have the source code). This JAR file open a simple AWT app. In my code I need to click on a button, copy a value of a text field and use…
Legend27
  • 1
  • 1
-1
votes
1 answer

Java: Robot Mouse Move Unknown Error

Summary: I am creating a program that moves the user's mouse to a predetermined, on-screen coordinate. The program shifts the mouse, coordinate by coordinate, to simulate human motion. The issue is that the program only moves the mouse to one of the…
-1
votes
1 answer

Java program works in Eclipse but not as a Jar file

I'm very new to programming and to learn something I made a simple auto clicker. My problem is that when I export it to jar using Eclipse or the command prompt the simulation of clicks doesn't work. It does load the GUI but when I press the button…
Ricky
  • 1
  • 2
-1
votes
1 answer

How to set a window invisible but focused?

I want to set a window invisible but focused for a fraction of seconds. I'm writing a key board emulator using Robot class as a part of project for detecting key loggers. Keyboard emulator should not disrupt the normal work of the user, so I want…
pinkpanther
  • 4,770
  • 2
  • 38
  • 62
-1
votes
2 answers

Differentiate between robotic and human keyboardinput

I want to "Select all" via a robot pressing the keys Control and A, but i dont want the keyboardListener to notice it as input. Is there another way to use "Select all" or a way to differentiate between the two input types? Edit: I'm using the…
Aaron Priesterroth
  • 307
  • 2
  • 4
  • 17
-1
votes
1 answer

RMI with Robot class

Problem: If we remotely (Remote Method Invocation application) set the co-ordinates of mouse of any other system using its IP for an infinite time then, control remains there for infinite time and our application hangs until the server of that…