Solved

Injecting Text into a running java application

Posted on 2012-12-26
2
174 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 27

Accepted Solution

by:
dpearson earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to count occurrences of each item in an array.

751 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