This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Low-level access to Java objects - Instantiating Objects
- From: Roland Besserer <roland at motorola dot com>
- To: kawa at sources dot redhat dot com
- Date: Fri, 11 Jul 2003 18:57:20 -0700
- Subject: Low-level access to Java objects - Instantiating Objects
- Organization: Motorola
- Reply-to: roland at motorola dot com
Hi,
maybe I'll start with a brief background on what I'm trying to
accomplish before getting to the question I have.
I am extending our build, configuration and test system currently based
on Guile (and customized version of greg, etc.) into the Java space. I
have had a good experience with Jython, which allows Python scripts to
be run in the JVM with direct access to Java objects. I plan on using
kawa in a similar fashion. Now the question.
I have been testing with the invoke-static/invoke methods for low-level
access to Java objects and although I can call class and instance
methods I'm in the dark on how to instantiate a Java object from kawa.
In Jython, I can do the following:
import javax.swing as swing // associates java package
with a name
win = swing.JFrame("Hello") // calls the JFrame constructor
win.size = (200,200)
win.show
Ok, that wouldn't work the same way in kawa and one would translate the
call: win.size = (200, 200) to setSize() but the real problem I have is
that I have not figured out how to actually construct the win object.
Could somebody enlighten me?
Regards
roland