[Jython-users] Jython cannot call public Java constructor?
by Nandan other posts by this author
Dec 13 2004 6:22AM messages near this date
Re: [Jython-users] Jython cannot call public Java constructor?
|
[Jython-users] Poll: What is Your Scripting Language for Java of the Year 2004?
I guess I'm missing something here. My main reference is the Jython
Essentials book, and it says you can use Java classes from jython,
although all the examples use classes within a namespace and/or within
jars.
Anyway, here's my Java code
class Cellrender extends JLabel implements ListCellRenderer {
public String path;
public Cellrender(String optype){
path="./icon.scripts/"+optype+"/";
}
public Cellrender() {}
public Component getListCellRendererComponent(
JList list, ... <snip>
And both in the jython REPL and on the cmdline I get the error:
java.lang.IllegalAccessException: java.lang.IllegalAccessException: Class
org.python.core.PyReflectedConstructor can not access a member of class
Cellrender with modifiers "public"
WTF? I thought private vars/fns couldn't be accessed?
in Jython I do
import Cellrender
f=Cellrender("test")
Before this of course, I javac the .java file, and the .class file is in
my current directory, which is also in the classpath.
Can anyone point out what I'm doing wrong, or a reference to read?
Thanks much,
N
--
Nandan Bagchee
We need a language that lets us scribble and smudge and smear, not a language
where you have to sit with a teacup of types balanced on your knee and make
polite conversation with a strict old aunt of a compiler.
-- Paul Graham
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Jython-users mailing list
Jython-users@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-users
|