Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Injecting Text into a running java application

Posted on 2012-12-26
2
Medium Priority
?
176 Views
Last Modified: 2013-02-04
I have a java app that i launch via a script that calls a .jar file.  That app (awt) is just a big form with jbutton and etc.  i DO NOT have the java source code for this app.

Is it possible to create a second app that will AUTOFILL corresponding fields with values retrieved from the db?

For example:  First name is entered into a webform, gets stored in a database and when the "second app" is executed it pulls the data and inserts it into the corresponding mapped field.

Decompiling is not an option as the app gets updates every now and then.

Need an out of the box solution!
0
Comment
Question by:Squadless
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
dpearson earned 2000 total points
ID: 38722420
Your best bet is to explore the "Robot" class:
http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

This will let you generate mouse events and keyboard events directly.  You should store the location of the fields on the webform in the second app alongside the data that should be entered in the field.  Then you can move the mouse to the correct place on screen, click in the text field and then send keyboard events to type in the values you wish to enter.

When the app is updated, you may need to update the location of the fields if they have moved to a new position on the screen.

Hope that helps,

Doug
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 38724300
Might be worth a look at http://teststack.github.com/White/
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question