Implementing in Netbeans 6.7.1
In order to use AdsToJava.dll in the current Netbeans project, TcJavaToAds.jar must be added to it. This article shows how to add the library and what imports are needed from it (please note that the instructions may need to be slightly varied on your system if the version you are using is different from this one):
First, Netbeans must be started, a new project must be created. After that please navigate to "Project" and right click on your new project. In the menu that opens, select "Properties".

In the next step, select the "Libraries" category and click the "Add JAR/Folder" button. In the file browser that appears, locate the TcJavaToAds.jar file.
It is located in the "TwinCAT\ADS Api\AdsToJava" directory.

Finally, the packages whose components you want to use must be imported. For this purpose you can find documented sample programs in the Information System.
import de.beckhoff.jni.AdsConstants;
import de.beckhoff.jni.Convert;
import de.beckhoff.jni.JNIByteBuffer;
import de.beckhoff.jni.JNILong;
import de.beckhoff.jni.JNIBool;
import de.beckhoff.jni.tcads.AdsCallDllFunction;
import de.beckhoff.jni.tcads.AdsCallbackObject;
import de.beckhoff.jni.tcads.AdsDevName;
import de.beckhoff.jni.tcads.AdsNotificationAttrib;
import de.beckhoff.jni.tcads.AdsNotificationHeader;
import de.beckhoff.jni.tcads.AdsState;
import de.beckhoff.jni.tcads.AdsSymbolEntry;
import de.beckhoff.jni.tcads.AdsVersion;
import de.beckhoff.jni.tcads.AmsAddr;
import de.beckhoff.jni.tcads.AmsNetId;
import de.beckhoff.jni.tcads.CallbackListenerAdsRouter;
import de.beckhoff.jni.tcads.CallbackListenerAdsState;