Eric,

that has to be trouble. What you want to do, I think, is directly 
address applet A from applet B:


JmolViewer getOtherAppletViewer(String appletName) {
    JSObject  jsoWindow = JSObject.getWindow(myAppletWrapper);
    if (jsoWindow == null)
     return null;

    JSObject jsoDocument = (JSObject) jsoWindow.getMember("document");
    if (jsoDocument == null)
      return null;

  JsoObject app = JsoDocument.getMember(appletName);
  return (app == null ? null :  JmolViewer app.getProperty("jmolViewer"));
 }

or


Object  getOtherAppletInfo(String appletName, String propertyName, 
String parameter) {
    JSObject  jsoWindow = JSObject.getWindow(myAppletWrapper);
    if (jsoWindow == null)
     return null;

    JSObject jsoDocument = (JSObject) jsoWindow.getMember("document");
    if (jsoDocument == null)
      return null;

  JsoObject(?maybe?)  app = JsoDocument.getMember(appletName);
  if (app == null)
   return null
 JmolViewer viewer = app.getProperty("jmolViewer");
    app.getProperty(propertyName, parameter)
 }


Totally bypassing JavaScript.

Bob

eric capps wrote:

>i'm doing this combination o javascript and java to try to get the  
>jmol Viewer into my other applet.
>
>javascript:
>     var bufferApplet = document.applets["JmolBuffer1"];
>     bufferApplet.setJmolViewer(_jmolGetApplet().getProperty 
>('jmolViewer'));
>
>java:
>     public void setJmolViewer(Object v){
>       jViewer = (Viewer)v;
>     }
>
>the javascript call makes it to the java method, and even makes it  
>with an object of the Viewer class! however, when i try to typecast  
>it to Viewer, or even do a (v instanceof Viewer), i get a  
>PrivilegedActionException. setJmolViewer(Viewer v), so i don't see a  
>solution other than typecasting. i'm sure it's something small, but i  
>can't for the life of me figure out how to get around this. is there  
>anyone who has successfully gotten jmol to interact with another java  
>applet that can give me some pointers? i can sort of see my error but  
>not how to resolve it.
>
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to