开发者

What does the Java Robot class do?

What function exactly does the Robot class in J开发者_如何学JAVAava serve? Does it press keys or what?


The robot class presses keys and uses the mouse.

Using this class, you can do five actions: press key, release key, move mouse, press mouse button, and release mouse button. It can also get the pixel color at a specific screen coordinate, or generate a screenshot in a BufferedImage.

These methods do not just fake this within Java, they access low-level windowing system input events directly. By using these methods, you can program something that will interact with an application for testing or automation. The full API is here.


It presses keys and moves the mouse. It basically fakes being a user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜