SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
Moving to the Client - JavaFX and HTML5
Stephen Chin	

Chief Agile Methodologist, GXS	

steveonjava@gmail.com tweet: @steveonjava	


Kevin Nilson	

VP of Engineering, Just.Me	

kevin.nilson@just.me tweet: @javaclimber
About the Presenters

 Stephen Chin                             Kevin Nilson
          Java Champion	

                         Java Champion	

  Chief Agile Methodologist, GXS	

         Author Web 2.0 Fundamentals	

   Author, Pro JavaFX Platform	

               User Groups Leader	





                                      Silicon Valley Web JUG
                                      Silicon Valley JS Meetup
                                      Silicon Valley Google Technology UG
This is a Participatory Session!
•  Every now and then we will say something
   interesting… and it will go out in a tweet.

•  Follow @steveonjava to watch the tweets and
   retweet the ones you like to your followers

•  Feel free to create your own tweets using the
   hash tags "#HTML5 #JavaFX #Devoxx"

•  We have some goodies for folks who play. J
History of the Web
1991 HTML
1994 HTML 2
1996 CSS 1 + JavaScript
1997 HTML 4
1998 CSS 2
2000 XHTML 1
2002 Tableless Web Design
2005 AJAX
2009 HTML 5
What is HTML5
•  Web Hypertext Application Technology Working
   Group (WHATWG)

•  HTML5 != HTML + CSS + JavaScript
•  HTML5 = Next Generation Features for Modern Web
   Development

•  Offline Storage, Web SQL Database, IndexedDB,
   Application Cache, Web Workers, WebSocket,
   Notifications, Native Drag & Drop, File System,
   GeoLocation, Speech Input, Form Types, Audio,
   Video, Canvas, SVG
HTML5 Rounded Corners

•  http://slides.html5rocks.com/#rounded-corners

      HTML5	

                  No HTML5
HTML5 Canvas 3D (WebGL)
•  http://oos.moxiecode.com/js_webgl/fish/
   index.html
Prefixes
•  -webkit-text-fill-color: black;
•  -webkit-column-count: 2;

•  Before the spec is final

•  Before the browser implementation is verified
Cross Browser
•  Browsers behave differently

•  HTML5 Non-Ambiguous Spec

•  JavaScript Frameworks (jQuery, Dojo, YUI) Give
   Consistent API
Acid Test
•  http://acid3.acidtests.org/
jQuery On The Rise
•  51% of Top 10,000 sites use jQuery
   (builtwith.com)
jQuery
 http://jsfiddle.net/3urR9/
Reaching Older Browsers
•  Chrome Frame
 – IE6, IE7, IE8 running Chrome
•  Modernizr
 – Feature Detection rather than User Agent Sniffing
Web on Mobile
•  iPhone UIWebView
  – Formatting Text




Indalo is an iPhone App Kevin Helped Write
Native Mobile Web
•  Titanium
  – Write JavaScript, but Renders
    Native Application

  – Many “Native” widgets are
    UIWebView




E*Trade API Contest App Kevin Wrote
JavaFX 2.0 Platform
Immersive Desktop Experience Combining
the Best of JavaFX and HTML5

•  Leverage your Java skills with modern
   JavaFX APIs

•  Integrate Java, JavaScript, and HTML5 in
   the same application

•  New graphics stack takes advantage of
   hardware acceleration for 2D and 3D
   applications

•  User your favorite IDE: NetBeans, Eclipse,
   IntelliJ, etc.
JavaFX and the Java Platform




              Java EE                  Java FX                 MSA              Java TV


                             Java SE                                  Java ME               Java Card




                                        HotSpot Java VM                          Lightweight Java VM




                                                      Java Language



Images Copyright Oracle
Architecture of JavaFX 2.0

               JavaFX Public API

                  Quantum Toolkit

          Prism           Glass   Media     Web
                          WinTk   Engine   Engine

 Java2D   Open GL   D3D


               Java Virtual Machine
Displaying HTML in JavaFX
public class WebViewTest extends Application {
  public static void main(String[] args) {
         launch(WebViewTest.class, args);
     }
     @Override public void start(Stage stage) {
         WebView webView = new WebView();
         webView.getEngine().load("http://google.com");
         Scene scene = new Scene(webView);
         stage.setScene(scene);
         stage.setTitle("Web Test");
         stage.show();
}}
JVM Language Options


•  Imperative Java
•  Java Builders
•  GroovyFX
•  ScalaFX
•  Visage
Displaying HTML in JavaFX
public class WebViewTest extends Application {
  public static void main(String[] args) {
         launch(WebViewTest.class, args);
     }
                            12 Lines
     @Override public void start(Stage stage) {
                        311 Characters
         WebView webView = new WebView();
         webView.getEngine().load("http://google.com");
         Scene scene = new Scene(webView);
         stage.setScene(scene);
         stage.setTitle("Web Test");
         stage.show();
}}
HTML in JavaFX Builders
public class WebViewTest extends Application {
 public static void main(String[] args) {
     launch(args);
 }
                          11 Lines
 @Override public void start(Stage stage) {
                       321 Characters
     WebView webView = WebViewBuilder.create().build();
     stage.setScene(SceneBuilder.create().root(webView).build());
     webView.getEngine().load("http://google.com");
     stage.setTitle("Web Test");
     stage.show();
}}
HTML in GroovyFX
GroovyFX.start { primaryStage ->
 def sg = new SceneGraphBuilder()
    sg.stage(
     title: 'Web Test',
     show: true) {             11 Lines
         scene () {         152 Characters
           wv = webView()
          }
     }
     wv.engine.load("http://google.com/")
}
HTML in ScalaFX
object WebViewTest extends JFXApp {
 stage = new Stage {
        title = "Web Test"
        scene = new Scene {
            WebView {                  10 Lines
                                   117 Characters
                location = "http://google.com/"
            }
        }
    }
}
HTML in Visage
Stage {
 title: "Web Test"
    Scene {
        WebView {
                                     8 Lines
            location: "http://google.com/"
        }                      67 Characters
    }
}
Calling Javascript from JavaFX
String script = "alert('We have got a message,
Houston!');”;
eng.executeScript(script);




                                                 26	
  
Responding to Browser Events
Supported Events:
•  Alert/Confirm/Prompt:
  – Respond to JavaScript user interaction functions
•  Resize:
  – Web page moves or resizes the window object
•  Status
  – Web page changes the status text
•  Visibility
  – Hide or show the window object
•  Popup
  – Spawn a second web view/engine
                                                       27	
  
HTML5/JavaFX Integration Demo




                                28	
  
Pro JavaFX 2 Platform Coming Soon!

           •  Coming 1st Quarter 2012
           •  All examples rewritten in Java
           •  Covers new controls including:
             – WebPane
             – TableView
             – TreeView
             – Etc.
           •  Content on ScalaFX/GroovyFX/Visage



                                               29	
  
Thank You!	

   Stephen Chin	

           Kevin Nilson	

steveonjava@gmail.com	

   kevin.nilson@just.me	

  tweet: @steveonjava	

   tweet: @javaclimber	





                                                     30	
  

Más contenido relacionado

La actualidad más candente

End to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) EuropeEnd to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) Europe
Alexandre Morgaut
 
Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3
Nuxeo
 
Developing Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsDeveloping Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with Grails
GR8Conf
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
GR8Conf
 

La actualidad más candente (20)

JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!JEE Conf 2015: Less JS!
JEE Conf 2015: Less JS!
 
angular-wakanda ngParis meetup 15 at 42
angular-wakanda ngParis meetup 15 at 42angular-wakanda ngParis meetup 15 at 42
angular-wakanda ngParis meetup 15 at 42
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices Architecture
 
End to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) EuropeEnd to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) Europe
 
001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about React
 
Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3Nuxeo WebEngine and GlassFish v3
Nuxeo WebEngine and GlassFish v3
 
Developing Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with GrailsDeveloping Mobile HTML5 Apps with Grails
Developing Mobile HTML5 Apps with Grails
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Demo on JavaFX
Demo on JavaFXDemo on JavaFX
Demo on JavaFX
 
Reactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOMReactjs Introduction - Virtual DOM
Reactjs Introduction - Virtual DOM
 
Spring Boot on Amazon Web Services with Spring Cloud AWS
Spring Boot on Amazon Web Services with Spring Cloud AWSSpring Boot on Amazon Web Services with Spring Cloud AWS
Spring Boot on Amazon Web Services with Spring Cloud AWS
 
Next.js with drupal, the good parts
Next.js with drupal, the good partsNext.js with drupal, the good parts
Next.js with drupal, the good parts
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Webpack 살펴보기
Webpack 살펴보기Webpack 살펴보기
Webpack 살펴보기
 
Spring cloud for microservices architecture
Spring cloud for microservices architectureSpring cloud for microservices architecture
Spring cloud for microservices architecture
 
XWiki Aquarium Paris
XWiki Aquarium ParisXWiki Aquarium Paris
XWiki Aquarium Paris
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
 
MySQL Aquarium Paris
MySQL Aquarium ParisMySQL Aquarium Paris
MySQL Aquarium Paris
 

Similar a Moving to the Client - JavaFX and HTML5

125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용
NAVER D2
 
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected BusinessWSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talk
Vijay Nair
 

Similar a Moving to the Client - JavaFX and HTML5 (20)

Play Support in Cloud Foundry
Play Support in Cloud FoundryPlay Support in Cloud Foundry
Play Support in Cloud Foundry
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 
JavaFX 2 Rich Desktop Platform
JavaFX 2 Rich Desktop PlatformJavaFX 2 Rich Desktop Platform
JavaFX 2 Rich Desktop Platform
 
Introduction to JavaFX
Introduction to JavaFXIntroduction to JavaFX
Introduction to JavaFX
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments Java 6 [Mustang] - Features and Enchantments
Java 6 [Mustang] - Features and Enchantments
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용125 고성능 web view-deview 2013 발표 자료_공유용
125 고성능 web view-deview 2013 발표 자료_공유용
 
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected BusinessWSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
WSO2Con Asia 2014 - WSO2 AppDev Platform for the Connected Business
 
WSO2 AppDev platform
WSO2 AppDev platformWSO2 AppDev platform
WSO2 AppDev platform
 
Web without framework
Web without frameworkWeb without framework
Web without framework
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
[English version] JavaFX and Web Integration
[English version] JavaFX and Web Integration[English version] JavaFX and Web Integration
[English version] JavaFX and Web Integration
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talk
 
Presentation JavaFX
Presentation JavaFXPresentation JavaFX
Presentation JavaFX
 
Presentation JavaFX
Presentation JavaFXPresentation JavaFX
Presentation JavaFX
 

Más de Stephen Chin

Más de Stephen Chin (20)

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
 
DukeScript
DukeScriptDukeScript
DukeScript
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Moving to the Client - JavaFX and HTML5

  • 1. Moving to the Client - JavaFX and HTML5 Stephen Chin Chief Agile Methodologist, GXS steveonjava@gmail.com tweet: @steveonjava Kevin Nilson VP of Engineering, Just.Me kevin.nilson@just.me tweet: @javaclimber
  • 2. About the Presenters Stephen Chin Kevin Nilson Java Champion Java Champion Chief Agile Methodologist, GXS Author Web 2.0 Fundamentals Author, Pro JavaFX Platform User Groups Leader Silicon Valley Web JUG Silicon Valley JS Meetup Silicon Valley Google Technology UG
  • 3. This is a Participatory Session! •  Every now and then we will say something interesting… and it will go out in a tweet. •  Follow @steveonjava to watch the tweets and retweet the ones you like to your followers •  Feel free to create your own tweets using the hash tags "#HTML5 #JavaFX #Devoxx" •  We have some goodies for folks who play. J
  • 4. History of the Web 1991 HTML 1994 HTML 2 1996 CSS 1 + JavaScript 1997 HTML 4 1998 CSS 2 2000 XHTML 1 2002 Tableless Web Design 2005 AJAX 2009 HTML 5
  • 5. What is HTML5 •  Web Hypertext Application Technology Working Group (WHATWG) •  HTML5 != HTML + CSS + JavaScript •  HTML5 = Next Generation Features for Modern Web Development •  Offline Storage, Web SQL Database, IndexedDB, Application Cache, Web Workers, WebSocket, Notifications, Native Drag & Drop, File System, GeoLocation, Speech Input, Form Types, Audio, Video, Canvas, SVG
  • 6. HTML5 Rounded Corners •  http://slides.html5rocks.com/#rounded-corners HTML5 No HTML5
  • 7. HTML5 Canvas 3D (WebGL) •  http://oos.moxiecode.com/js_webgl/fish/ index.html
  • 8. Prefixes •  -webkit-text-fill-color: black; •  -webkit-column-count: 2; •  Before the spec is final •  Before the browser implementation is verified
  • 9. Cross Browser •  Browsers behave differently •  HTML5 Non-Ambiguous Spec •  JavaScript Frameworks (jQuery, Dojo, YUI) Give Consistent API
  • 11. jQuery On The Rise •  51% of Top 10,000 sites use jQuery (builtwith.com)
  • 13. Reaching Older Browsers •  Chrome Frame – IE6, IE7, IE8 running Chrome •  Modernizr – Feature Detection rather than User Agent Sniffing
  • 14. Web on Mobile •  iPhone UIWebView – Formatting Text Indalo is an iPhone App Kevin Helped Write
  • 15. Native Mobile Web •  Titanium – Write JavaScript, but Renders Native Application – Many “Native” widgets are UIWebView E*Trade API Contest App Kevin Wrote
  • 16. JavaFX 2.0 Platform Immersive Desktop Experience Combining the Best of JavaFX and HTML5 •  Leverage your Java skills with modern JavaFX APIs •  Integrate Java, JavaScript, and HTML5 in the same application •  New graphics stack takes advantage of hardware acceleration for 2D and 3D applications •  User your favorite IDE: NetBeans, Eclipse, IntelliJ, etc.
  • 17. JavaFX and the Java Platform Java EE Java FX MSA Java TV Java SE Java ME Java Card HotSpot Java VM Lightweight Java VM Java Language Images Copyright Oracle
  • 18. Architecture of JavaFX 2.0 JavaFX Public API Quantum Toolkit Prism Glass Media Web WinTk Engine Engine Java2D Open GL D3D Java Virtual Machine
  • 19. Displaying HTML in JavaFX public class WebViewTest extends Application { public static void main(String[] args) { launch(WebViewTest.class, args); } @Override public void start(Stage stage) { WebView webView = new WebView(); webView.getEngine().load("http://google.com"); Scene scene = new Scene(webView); stage.setScene(scene); stage.setTitle("Web Test"); stage.show(); }}
  • 20. JVM Language Options •  Imperative Java •  Java Builders •  GroovyFX •  ScalaFX •  Visage
  • 21. Displaying HTML in JavaFX public class WebViewTest extends Application { public static void main(String[] args) { launch(WebViewTest.class, args); } 12 Lines @Override public void start(Stage stage) { 311 Characters WebView webView = new WebView(); webView.getEngine().load("http://google.com"); Scene scene = new Scene(webView); stage.setScene(scene); stage.setTitle("Web Test"); stage.show(); }}
  • 22. HTML in JavaFX Builders public class WebViewTest extends Application { public static void main(String[] args) { launch(args); } 11 Lines @Override public void start(Stage stage) { 321 Characters WebView webView = WebViewBuilder.create().build(); stage.setScene(SceneBuilder.create().root(webView).build()); webView.getEngine().load("http://google.com"); stage.setTitle("Web Test"); stage.show(); }}
  • 23. HTML in GroovyFX GroovyFX.start { primaryStage -> def sg = new SceneGraphBuilder() sg.stage( title: 'Web Test', show: true) { 11 Lines scene () { 152 Characters wv = webView() } } wv.engine.load("http://google.com/") }
  • 24. HTML in ScalaFX object WebViewTest extends JFXApp { stage = new Stage { title = "Web Test" scene = new Scene { WebView { 10 Lines 117 Characters location = "http://google.com/" } } } }
  • 25. HTML in Visage Stage { title: "Web Test" Scene { WebView { 8 Lines location: "http://google.com/" } 67 Characters } }
  • 26. Calling Javascript from JavaFX String script = "alert('We have got a message, Houston!');”; eng.executeScript(script); 26  
  • 27. Responding to Browser Events Supported Events: •  Alert/Confirm/Prompt: – Respond to JavaScript user interaction functions •  Resize: – Web page moves or resizes the window object •  Status – Web page changes the status text •  Visibility – Hide or show the window object •  Popup – Spawn a second web view/engine 27  
  • 29. Pro JavaFX 2 Platform Coming Soon! •  Coming 1st Quarter 2012 •  All examples rewritten in Java •  Covers new controls including: – WebPane – TableView – TreeView – Etc. •  Content on ScalaFX/GroovyFX/Visage 29  
  • 30. Thank You! Stephen Chin Kevin Nilson steveonjava@gmail.com kevin.nilson@just.me tweet: @steveonjava tweet: @javaclimber 30