Page 2 of 2
Java_MyWindow_paint is the entry point that the JVM will invoke for drawing the MyWindow. The helper function DrawSmiley does the actual rendering using Win32 calls. To include GetDrawingSurfaceInfo in your application, use the jawt.lib external library (see "Build the environment").
BUILD.BAT before running it and set the path for your Visual C++ 6.0 and JDK 1.3 directories as shown below. The BUILD.BAT compiles MyWindow.java, generates MyWindow.h, and then compiles MyWindow.CPP into MyWindow.DLL.SET DEVSTUDIO=D:\Program Files\Microsoft Visual Studio\VC98 SET JDK13=D:\JDK1.3
That's it; you are ready to go. Before running the sample, make sure that MyWindow.DLL, \JDK1.3\BIN, and \JDK1.3\JRE\BIN are in your PATH, and that the current directory is in CLASSPATH; this will guarantee that MyWindow.class will load successfully. After making sure that the PATH and CLASSPATH are set properly, enter java MyWindow on the command line to run the application. A RUN.BAT batch file is included in window.zip (see Resources) for your convenience. Edit RUN.BAT to set the PATH and CLASSPATH for JDK 1.3.
include/jawt.h.
include/win32/jawt_md.h.
According to the JavaSoft Website, these headers are not part of the Java 2 Platform's official specification; rather, they are provided as a convenience to developers who want a standardized way to access native drawing functionality. I think this means that people who port the JDK to other platforms can choose not to expose this API.
jawt.lib, has been added to the SDK's library directory. As explained earlier, it has the entry points needed for including J2AWT
in your application. For example, to link to the GetDrawingSurfaceInfo entry point, you need to include jawt.lib in your build.
javah tool is used to generate the C/C++ header file for the native functions of the Java class, and the javac tool is used to compile the Java source.