Content deleted Content added
m Fixed grammar and language. Tags: Visual edit Mobile edit Mobile web edit Newcomer task Newcomer task: copyedit |
→Create a Java application: I changed the tone or style to reflect the encyclopedic tone used in Wikipedia. |
||
Line 17:
A complete walkthrough example of this technology is available on Wikibooks (see link below).
A comprehensive example demonstrating this technology is available on Wikibooks (refer to the link below).
See the [[Java Native Interface]] article for an explanation of the <code>native</code> [[keyword (computer programming)|keyword]] and the <code>loadLibrary()</code> method. A <code>paint()</code> method will be simply invoked when the AWT [[event dispatching thread]] "repaints" the screen.▼
▲
Following the creation of the Java application, a C++ header file is generated conventionally. Detailed explanations can be found in the Java Native Interface documentation.
Next, the C++ native code is implemented, typically in a file named "NativeSideCanvas.cpp," and compiled into a library. Further information on this process is provided in the Java Native Interface (JNI) documentation.
Once the program is constructed, it can be executed as per usual. Upon running the file, a window should appear, displaying, for example, a drawn rectangle. Detailed instructions can be found in the Java Native Interface documentation.
Note: One can notice that the AWT Native Interface requires the "jawt.dll" (or "jawt.so") to run with the application, so the easiest way to do that is copying the "jawt.dll". (should be in the .../jre/bin [[file path]] of the JDK's installation path.){{citation needed|date=June 2012}}▼
▲
== Native painting ==
|