Java Robot is a part of Java AWT (Abstract Window Toolkit ) package . Java Robot is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The purpose of using Java Robot is to gain the control of input events such as mouse, keyboard etc.
In this article we will create a Magnifying toolusing JAVA Robot .
Methods used :
- getPointerInfo() : Returns a PointerInfo instance that represents the current location of the mouse pointer.
- getLocation() : returns a point instance that represents location
- createScreenCapture(Rectangle r) : captures a part of screen which is within the rectangle r.
- drawImage(Image i, int x, int y, ImageObserver o) : draws an image at x, y position on the screen specifying an image observer
- drawImage(Image i, int x, int y,,int w, int h, ImageObserver o) : draws an image at x, y position and specified width and height on the screen specifying an image observer
Java program to create a Magnifying tool using Java Robot
Note: the following program might not run in an online compiler please use an offline IDE.Please use a latest version of java
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- JSwing | Create Translucent and Shaped Windows in Java
- Automate mouse events using Java Robot Class
- Robot Class in Java AWT
- Java Robot Class | Get the pixel Color of a given point
- How to Create a Color Picker Tool in Android using Color Wheel and Slider?
- How to create a user defined javap tool?
- How to Create a Basic Color Picker Tool in Android?
- Java Deprecated API Scanner tool (jdepscan) in Java 9 with Examples
- javap tool in Java with Examples
- Gradle Build Tool I Modern Open Source Build Automation
- What is JavaDoc tool and how to use it?
- How to create a REST API using Java Spring Boot
- Create a Table in a PDF Using Java
- Java Program to Create an Object for Class and Assign Value in the Object Using Constructor
- Create n-child process from same parent process using fork() in C
- How to create a Circular image view in Android without using any library?
- How to create a Facebook login using an Android App?
- How to create a Stopwatch App using Android Studio
- How to create a CalendarPickerView using TimeSquare library
- How to create popup message using Alerter Library in android
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.