Have Java control a button in a specific program

From Visual Basic to GNU C, this is the place to talk programming.

Moderators: SecretSquirrel, just brew it!

Have Java control a button in a specific program

Postposted on Tue Mar 19, 2013 10:02 pm

Hey all,

I have been playing with Robot but robot only controls a keypress system wide. Is there a way to have java say, hit F5 in the browser, WHILE other programs are open and are the active window? Essentially, have java refresh the browser while the browser is in the background. Is this possible or no? After some heavy googling, I'm thinking no, but decided to ask.
i7-2600k (4.1Ghz), 16GB DDR3-1600, 6970 2GB, GA-Z68X-UD3H-B3, Recon3D Audio (PCI-E), WD 1TB Black (os/programs), WD 2TB Green (games), WD 3TB Green (movies/music), Win 8.1 Pro x64
Check out my site for trance mixes and other goodies! linserv.biz.tm
ClickClick5
Gerbil XP
Gold subscriber
 
 
Posts: 456
Joined: Fri Aug 15, 2008 8:28 pm
Location: Somewhere in a land the doctor says does not exist...

Re: Have Java control a button in a specific program

Postposted on Tue Mar 19, 2013 11:23 pm

Not sure about java, but javascript will do it:
Code: Select all
document.getElementById("myButtonsId").click()


Just stuff that in your settimeout or setinterval function.
jihadjoe
Gerbil Team Leader
 
Posts: 255
Joined: Mon Dec 06, 2010 11:34 am


Return to Developer's Den

Who is online

Users browsing this forum: No registered users and 1 guest