1. Get setupThis is easiest in Linux, I'm running Ubuntu (in vmware), and installed
antlr 2.x python2.5.x sun java6 pygtk java-gnomeYou can install them like this:
# sudo apt-get install antlr python2.5 sun-java6-bin libjava-gnome-javaThen install Python2Java with easy_install
# sudo easy_install-2.5 java2pythonTo test if it's working run j2py -i. It should complain there is no file:
# j2py -i Usage: j2py [options] j2py: error: -i option requires an argumentIf you get any other errors your missing some packages.
2. Get the Java Code from the Simple Example.Save the 'simple.java' example as 'GSimple.java' If java-gnome is running ok, compiling and running it you should see a window:
# javac GSimple.java # java GSimple
Now we'll run through the code, it's important to understand what it does before we port it... (more…)