JPython?

Jim Althoff jima at aspectdv.com
Thu Oct 14 15:54:14 EDT 1999


Hi Hank,

I have been using the following methodology
and it works pretty well.

I start with JBuilder3 from Inprise/Borland.

I use its visual developer tool to "draw" a
user interface.  JBuilder3 is pretty decent
because it supports Java2 and Swing
and lets you drag & drop the Swing
widgets, specify the bean properties in
forms, and even use forms to set up
the advanced awt layout managers like
gridBagLayout -- which I use a lot to
make dialogs and user-input forms that
resize intelligently on the screen.
JBuilder3 will generate and compile the 
corresponding Java/Swing code.  It
does a nice job of just generating the
basic code without putting in special
comments and extra tagging junk.
You can make JFrames, JPanels,
JPanels with JTrees and JTables 
inside of JScrollPanes, etc.
Basically anything you need.

Once I have a "visually drawn" and
"auto-generated" user-interface
layout class, I then switch to JPython.

I write a JPython class that is sort of
a "View / Controller".  In the JPython
class I make an instance of the JBuilder3-
generated "layout" class.  I then do all
of the event handling and application
logic inside the JPthon "View / Controller"
class, manipulating the Swing elements
in the JBuilder3-generated instance as
needed.

With this methodology, all of the 
"programming" is done using JPthon
and yet the static user interface elements
are "drawn" with a visual tool (JBuilder3).

As I said, it has been working great for
me.

Jim


At 02:56 PM 10/14/99 -0400, Hank Fay wrote:
>Jim,
>
>    is there a visual application development environment, using the Java
>API, that will work with JPython?
>
>    tia,
>
>Hank
>
>--
>http://www.prosysplus.com
>Jim Althoff <jima at aspectdv.com> wrote in message
>news:199910132322.QAA11710 at hermes.aspectdv.com...
>> As a very active JPython user, here is my take on it.
>>
>> Yes, you can think of JPython as a mechanism
>> that lets you run "Python" in a Web browser that supports
>> Java.  You can also look at it as a mechanism for
>> adding scripting capability to Java applications.
>>
>> But I think of it in a somewhat different way.
>> JPython is a second implementation of Python
>> that uses the Java VM instead of the Python
>> runtime.  Why is this useful?  Because of the
>> following tradeoffs.  In JPython you don't have
>> access to Python C-based extension modules.
>> Bad, obviously.  But you do have access to
>> the basic core language structures and to
>> any Python modules implemented completely
>> in Python.  Neutral -- obviously you have this
>> in standard Python as well.  But, the real kicker
>> is this: with JPython you DO have complete
>> access to ALL Java APIs.   Without having to
>> do any work at all. No wrappers, no JNI, no CORBA
>> no anything.   Instant availability.  All in the
>> same JVM.
>>
>> I am in a situation where I need to develop
>> huge applications and for various business
>> and other reasons I am absolutely committed
>> to using Java APIs (Swing for the UI, etc.).
>>
>> Without JPython, Java is the only real choice
>> for programming the applications
>> since doing wrappers to make all Java APIs
>> available in Python is just not practical.
>>
>> With JPython, though, I can develop all of my
>> applications using the Python language
>> (as opposed to the C-Python implementation)
>> and still make use of all the Java APIs.
>>
>> Personally, I believe the Java APIs are
>> gaining enormous momentum for applications
>> programming.  I think the ability to program
>> in a high-level, dynamic language like Python
>> while having seamless access to all of the Java
>> APIs is a killer combination.
>>
>> Jim
>>
>>
>>
>> At 03:00 PM 10/13/99 -0500, Dan Star wrote:
>> >Let me see if I am understanding what JPython is.  Is it a just-in-time
>> >compiler that translates python code to java byte-code so that the
>> >python code can run in a WEB browser that supports java?  If so, I would
>> >assume this places many restricitions on the Python language elements
>> >you can use.  Or is JPython a seperate implementation of Python with its
>> >own language set?
>> >
>> >--Dan
>> >
>> >--
>> >http://www.python.org/mailman/listinfo/python-list
>> >
>>
>>
>
>
>
>-- 
>http://www.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list