PDA

Click to See Complete Forum and Search --> : [RESOLVED] Java's Equivalent Of OLE Automation


MethadoneBoy
Apr 10th, 2008, 09:44 AM
Hi guys,

Is there any facility or API in Java that can allow a Java application to interface/interact with other Java-based applications on a user's PC? From my experience in VB programming I know that some applications have OLE Automation that allows Microsoft applications to execute commands. Is there a Java equivalent to this process? A Java way of doing something similar to the following -

Dim objXL As Object
Set objXL = GetObject(, "Excel.Application")
'I'm not looking to interface with Excel using Java,
'I've just used it as an example here

Any help would be appreciated.

Thanks

ComputerJy
Apr 10th, 2008, 12:28 PM
What is it you're trying to accomplish?

MethadoneBoy
Apr 11th, 2008, 03:36 AM
A Java-based database application that our company uses (front-end is a series of GUIs accessible via Internet Explorer, back-end is a SQL Server database) involves a lot of repetitive, manual data entry for certain tasks. I'm looking for a way to write an application that will listen or detect for certain events (such as particular forms or windows opening) or will get text from specific parts of the screen and can then interact with the application in some way (print/send text to its forms, etc).

The reason I'm asking is because we have an older database application that was written in Visual Basic (I think) that has a series of functions and objects that can be called in user-written Visual Basic applications to automate data input. I'd like to know if it's possible to do something similar to this in Java.

ComputerJy
Apr 11th, 2008, 06:26 AM
I'm not sure because I've never done something like this but I guess java instrumentation (http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html) might be what you need

MethadoneBoy
Apr 14th, 2008, 04:31 AM
Looks interesting, thanks for the tip.

MethadoneBoy
Apr 16th, 2008, 04:30 AM
Just found a link that's quite interesting. While it couldn't be described as Java's equivalent of OLE Automation it does allow for you to write a programme that will automate manual form input - the Java Robot Class. (http://www.developer.com/java/other/article.php/2212401) Worth a read if you're not familiar with it.

ComputerJy
Apr 16th, 2008, 04:38 AM
Thanks for sharing
looks interesting, I've never seen it before :thumb:

MethadoneBoy
Apr 16th, 2008, 08:55 AM
I've written a (very) basic class that successfully interacts and performs functions on a couple of web-based forms that we use internally here. So it's got a lot of potential for any other businesses with similar processes out there. What I need to do now, of course, is find out how to use Java to determine if a window/form has fully loaded and ready for input. But that's another thread (possibly). Then again, the Instrumentation API looks very useful in that regard.