Simple Example
From jpen
JPenExample.java shows how to listen pen events over a component and print them on the standard output. You need Java 5 to use JPen.
Running the Example on Linux
- Launch a bash shell and make shure that you have the following files in the current directory:
- jpen-2.jar and libjpen-2.so. These files are contained in the JPen library zip.
- The compiled JPenExample.class example file.
- Run the following commands:
- $ export LD_LIBRARY_PATH=.
- $ java -cp jpen-2.jar:. JPenExample
- $ export LD_LIBRARY_PATH=.
Running the Example on Windows
- Prepare a directory with the following files:
- jpen-2.jar and jpen-2.dll. These files are contained in the JPen library zip.
- The compiled JPenExample.class example file.
- Open a command prompt and go to the directory of the previous step. Run the following command:
- java -cp jpen-2.jar;. JPenExample
- Note: jpen-2.dll must be in the directory where you are running the example (or any other directory of your PATH) for JPen being able to load it. If jpen-2.dll can not be loaded, then JPen will only get data from your mouse (no pen pressure info...).
