iMacros and Java using NetBeans and jawin

Share your tips, tricks and favorite iMacros macros, scripts and applications for web automation in general here.

Moderator: iMacros Moderators

iMacros and Java using NetBeans and jawin

by Hannes, Tech Support on Wed Jun 03, 2009 3:02 am

(Note that we are not affiliated with the NetBean or jawin project. If you use jawin in your project, don't forget to check the jawin license.
And: an Eclipse tutorial can be found here:

1)Download the jawin ZIP from, unzip it to some place on your disk

2) Create/Set up NetBeans Java project:

Create new project:
new.project.png (11.05 KIB) Viewed 11573 times

Select Java application: (33.07 KIB) Viewed 11571 times

Enter project name: (28.89 KIB) Viewed 11577 times

Open dialog to add jawin library:
add.library.png (17.63 KIB) Viewed 11569 times

Select "\lib\jawin.jar" from the unzipped jawin directory:
select.jawin.jar.png (29.14 KIB) Viewed 11573 times

Add "\binjawin.dll" from the unzipped jawin directory to the "Windows/system32" folder:
jawin.dll.png (30.31 KIB) Viewed 11565 times

3) Make the "" look like this:
Code: Select all
 * To change this template, choose Tools | Templates
 * and open the template in the editor.

package imacrostest;

//This code makes use of jawin from
//jawin license:

//two imports from jawin.jar
import org.jawin.DispatchPtr;
import org.jawin.win32.Ole32;

 * @author name
public class Main {

     * @param args the command line arguments
 public static void main(String[] args) {
      try {

         DispatchPtr app = new DispatchPtr("imacros");

         //Calling iMacros methods
         app.invoke("iimInit", null);
         app.invoke("iimPlay", "CODE:URL GOTO=");
         app.invoke("iimPlay", "CODE:TAG POS=1 TYPE=A ATTR=TXT:iMacros EXTRACT=TXT");

         //manually cast return values to correct type
         String iret = app.invoke("iimGetLastExtract").toString();



      catch (Exception e){



Hannes, iOpus Support
Hannes, Tech Support
Posts: 2120
Joined: Thu Sep 21, 2006 6:27 am

Return to How-To's and useful iMacros: All other topics

Who is online

Users browsing this forum: No registered users and 1 guest