Solved

Injecting Text into a running java application

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

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

630 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