< prev index next >

samples/browser_dom.js

Print this page
rev 1358 : 8067636: ant javadoc target is broken
Reviewed-by: hannesw, lagergren


  23  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32  */
  33 
  34 if (!$OPTIONS._fx) {
  35     print("Usage: jjs -fx browser_dom.js");
  36     exit(1);
  37 }
  38 
  39 // JavaFX classes used
  40 var ChangeListener = Java.type("javafx.beans.value.ChangeListener");
  41 var Scene     = Java.type("javafx.scene.Scene");
  42 var WebView   = Java.type("javafx.scene.web.WebView");
  43 var EventListener = Java.type("org.w3c.dom.events.EventListener");
  44 
  45 // JavaFX start method
  46 function start(stage) {
  47     start.title = "Web View";
  48     var wv = new WebView();
  49     wv.engine.loadContent(<<EOF
  50 <html>
  51 <head>
  52 <title>
  53 This is the title
  54 </title>
  55 <script>
  56 // click count for OK button
  57 var okCount = 0;
  58 </script>
  59 </head>
  60 <body>
  61 Button from the input html<br>
  62 <button type="button" onclick="okCount++">OK</button><br>
  63 </body>




  23  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  24  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32  */
  33 
  34 if (!$OPTIONS._fx) {
  35     print("Usage: jjs -fx browser_dom.js");
  36     exit(1);
  37 }
  38 
  39 // JavaFX classes used
  40 var ChangeListener = Java.type("javafx.beans.value.ChangeListener");
  41 var Scene     = Java.type("javafx.scene.Scene");
  42 var WebView   = Java.type("javafx.scene.web.WebView");

  43 
  44 // JavaFX start method
  45 function start(stage) {
  46     start.title = "Web View";
  47     var wv = new WebView();
  48     wv.engine.loadContent(<<EOF
  49 <html>
  50 <head>
  51 <title>
  52 This is the title
  53 </title>
  54 <script>
  55 // click count for OK button
  56 var okCount = 0;
  57 </script>
  58 </head>
  59 <body>
  60 Button from the input html<br>
  61 <button type="button" onclick="okCount++">OK</button><br>
  62 </body>


< prev index next >