0 Replies Latest reply: Nov 29, 2011 9:35 AM by 901807 RSS

    Same javaFX jar, many applet instances in the same page

    901807
      Hi all



      I want to know if it is possible to embed a javaFX in a JSP/HTML page many times without instantiating many times the Java Console panel, for example, I have this code:
      <script>
                   function loadFX(){
                                      loadLMCFX();
                          loadLMCCFX();
                          
                }     
      
                      function loadLMCFX(){
                          try{
                               var lmcFX = javafxString(
                                       {
                                        archive: "https://extced.organization.com/LightFX.jar",
                                        draggable: true,
                                        width: 300,
                                        height: 320,
                                        code: "com.organization.business.main.MainLMC",
                                        name: "MainLMC", 
                                        id: 'MainLMC'
                                      }
                              );
                               document.getElementById('lmcFXDiv').innerHTML = lmcFX ;
                          } catch(err){}
                     }
                     
                     function loadLMCCFX(){
                          try{
                               var lmccFX = javafxString(
                                       {
                                        archive: "https://extced.organization.com/LightFX.jar",
                                        draggable: true,
                                        width: 300,
                                        height: 320,
                                        code: "com.organization.business.main.MainLMCC",
                                        name: "MainLMCC", 
                                        id: 'MainLMCC'
                                      }
                              );
                               document.getElementById('lmccFXDiv').innerHTML = lmccFX ;
                          } catch(err){}
                     }
                </script>
      both applets are calling same jar, but different classes.
      What happens is that if I put more than 3 applets in same JSP/HTML, I can see that sometimes 2 Java Console Panels are displayed. Sometimes one of the applets is not rendered. Sometimes it takes too much time to load one (or many) of the applets.

      I want to know how to avoid these kind of problems, maybe I'm not using the right approach, but I want to know your expert opinion regarding this ;).

      Any hint will be appreciated

      Regards