Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

get focus to the textbox

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
After I opened a website using a browser called from my Java program, I want to send text to an input textbox in this website using Java and Robot class without using Selenium WebDriver. So how to get focus to that textbox? I know how to use 'Robot class' to send values to the field.
 
Master Rancher
Posts: 4606
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I know how to use 'Robot class'  


One way to get focus on a textbox is to click on it.  The Robot class can send a  click  to anywhere on the screen.  It just needs an x,y position inside the textbox.
Another way might be to click on the page and send a tab.
 
mar abed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks , would you please explain or give example about : send a tab.

Norm Radder wrote:

I know how to use 'Robot class'  


One way to get focus on a textbox is to click on it.  The Robot class can send a  click  to anywhere on the screen.  It just needs an x,y position inside the textbox.
Another way might be to click on the page and send a tab.

 
Norm Radder
Master Rancher
Posts: 4606
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this sends a tab:
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic