Hello Frank,

> how can I access a public baseclass attribute in a Java class via Jacl,
> when an object of derived class is instanciated ?
> public class baseClass { public String dummyAttribute; }
> public class derivedClass extends baseClass { /* anything */ }

> set theDerivedObj [java::new derivedClass]
> java::field $theDerivedObj dummyAttribute  "blabla"     // RUNTIME ERROR
> // brings error tcl.lang.TclException: field "name" doesn't exist

You can use java::cast to let Jacl know the class, where it
should look for the attribute:

  java::field [java::cast baseClass $theDerivedObj] dummyAttribute "blabla"

"Nicht schoen, aber selten"

Hope, that helps,
Krischan
-- 
Christian Krone, SQL Datenbanksysteme GmbH

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to