Your SlideShare is downloading. ×
Moving to the Client - JavaFX and HTML5
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Moving to the Client - JavaFX and HTML5

3,323
views

Published on

Published in: Technology, Design

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,323
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
34
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Moving to the Client - JavaFX and HTML5Stephen 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 Web1991 HTML1994 HTML 21996 CSS 1 + JavaScript1997 HTML 41998 CSS 22000 XHTML 12002 Tableless Web Design2005 AJAX2009 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
  • 10. Acid Test•  http://acid3.acidtests.org/
  • 11. jQuery On The Rise•  51% of Top 10,000 sites use jQuery (builtwith.com)
  • 12. jQuery http://jsfiddle.net/3urR9/
  • 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 TextIndalo is an iPhone App Kevin Helped Write
  • 15. Native Mobile Web•  Titanium – Write JavaScript, but Renders Native Application – Many “Native” widgets are UIWebViewE*Trade API Contest App Kevin Wrote
  • 16. JavaFX 2.0 PlatformImmersive Desktop Experience Combiningthe 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 LanguageImages 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 JavaFXpublic 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 JavaFXpublic 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 Builderspublic 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 GroovyFXGroovyFX.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 ScalaFXobject WebViewTest extends JFXApp { stage = new Stage { title = "Web Test" scene = new Scene { WebView { 10 Lines 117 Characters location = "http://google.com/" } } }}
  • 25. HTML in VisageStage { title: "Web Test" Scene { WebView { 8 Lines location: "http://google.com/" } 67 Characters }}
  • 26. Calling Javascript from JavaFXString script = "alert(We have got a message,Houston!);”;eng.executeScript(script); 26  
  • 27. Responding to Browser EventsSupported 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  
  • 28. HTML5/JavaFX Integration Demo 28  
  • 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