Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to perform enter key action in onscreen keyboard in java using swing ?plz post code.
Posted
Updated 30-Aug-22 23:18pm

consider java.awt.robot is not the only robot in java, i think there are more for example in ojfx as well and similar external solution but for now as a simple straight forward beginner solution:

java.awt.Robot rb=new java.awt.Robot();
rb.keyPress(java.awt.event.KeyEvent.VK_ENTER);
rb.keyRelease(java.awt.event.KeyEvent.VK_ENTER);

I hope you already know how to use modify and optimise this code/ i know it's not in it's best form

bye
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900