I am been working with Jython for around two weeks and decided to use it to write some of my applications. Combining the power of two heavy weights like Java and Python makes good sense for the move. I have been experimenting porting scientific Java applications to Jython with some success until I got stuck for a day when I try to use an abstract class of the Open Source Physics library. I had my first contact with the library through the book "An Introduction to Computer Simulation Methods".

The library is a JAR called osp.jar and can be found here: http://www.opensourcephysics.org/binary/osp.jar

The program in Java work fine with no trouble at all. This is the Java code: CalculationApp.java

After you installed the osp.jar and have run the java file you will see that what this program does is to create a frame with some data in it, some buttons (calculate and reset), and also show the input boxes and results in the message area below. It's powerful and simple and we could write as many variables and formulas as we want allowing us to focus on the problem.

The program I wrote in Jython shows the frame and buttons but it does not show the input boxes above. I know that I am not calling correctly the Java abstract class and that could be the reason.

The Jython file is this: CalculationApp.py The control.println() method is not being recognized (gives me error, and had to enclosed them as comments), and it won't show up in the frame. Boy, I have been spending hours on trying to solve this -not enough sharp in Jython.

Hope you guys could give me hand on this.

Thanks a lot.

PS. Just for the sake of testing, I am adding a program from the Open Source Physics that I ported and does work; it is frame with a plot. SimplePlot.py

View this message in context: Jython - How to deal with Abstract Classes - Open Source Physics
Sent from the jython-users mailing list archive at Nabble.com.