WHITE PAPERS  |  PRICING  |  DOWNLOADS

 

username

password

 

 

 

 

 

 

 

 

 

 

  Desktop Edition Details  

 

  > Features  

  > Key Benefits  

  > Screenshots  

  > Standards Supported  

  > Pricing  

  > Download Now

 

 

  Developer Resources  

 

  > API Documentation  

  > Developers Guide  

  > Code Examples  

  > Updated Builds  

  > Technical Articles  

 

 

 

 

 

Jump to:

General WebRenderer Functions

  WebRenderer example code base.

 

Advanced WebRenderer functions

 

Application test examples

 

Deploying WebRenderer

WebRenderer DOM

  

  

 

JavaScript to Java communication with WebRenderer

 

 

Click here to download the complete example code

 

Communicating from JavaScript back to Java

The WebRenderer
 WRUIprotocol allows for communication from JavaScript  to Java. Using the WRUI protocol you can directly communicate with Java and with some simple handler code you can drive methods, assign variables etc.

Example: (HTML file with JavaScript calling through to Java when an HTML Button is clicked)

                <HTML>
                <SCRIPT JAVASCRIPT>
                                function runJavaCode(){
                                                document.location = "wrui://runConsoleOutput";
                                }
                </SCRIPT>

                <HEAD><TITLE>WebRenderer - WRUI Test Page</TITLE></HEAD>
                <BODY>
                <BR>
                Press this button <INPUT type=button value='Click to execute' onclick='runJavaCode()'> execute                 JavaScript that will call a Java function
                </BODY>
                </HTML>

// Java
                 browser.addBrowserListener(new BrowserAdapter(){
                        public void onBeforeNavigate(BrowserEvent e){
                                //Catching the WRUI communication
                                if(e.getURL().equals("wrui://runConsoleOutput/")){
                                        //Calling a Java method using WRUI as a communication bridge
                                        runConsoleOutput();
                                }
                        }
                });

Click here to download the complete example code

  top

 

 

 Sun, Sun Microsystems, and the Sun Logo are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries 

Privacy Policy  |   Disclaimer