0
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification f...
Upcoming SlideShare
Loading in...5
×

JJUG-Whats-New-For-JavaFX-in-JDK8

10,170

Published on

Published in: Technology, News & Politics

Transcript of "JJUG-Whats-New-For-JavaFX-in-JDK8"

  1. 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 131New JavaFX Features in JDK 8(after a gentle intro to app development with JavaFX)Jim WeaverJava Technology AmbassadorOracle Corporation@JavaFXpertjames.weaver@oracle.com
  2. 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 132 Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16ProgramAgenda Intro to app development with JavaFX– Obtaining JavaFX resources– Creating a user interface– Using Scene Builder and FXML New JavaFX Features in JDK 8– Some new Java features in JDK 8– New JavaFX Features in JDK 8
  3. 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 133 3Please noteThe following is intended to outline our general productdirection. It is intended for information purposes only, andmay not be incorporated into any contract. It is not acommitment to deliver any material, code, or functionality,and should not be relied upon in making purchasingdecisions. The development, release, and timing of anyfeatures or functionality described for Oracle’s productsremains at the sole discretion of Oracle.
  4. 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 134■ An API included in Java SE 7/8for UI development■ The successor to Java Swing■ Not the JavaFX Script language4JavaFX is:
  5. 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 135To Get JavaFX, Download Java 7
  6. 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 136To Develop JavaFX, Use Your Fav IDE
  7. 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 137 7Start Here: http://javafxcommunity.com
  8. 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 138 8Download JDK 8 Early Access Release
  9. 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 139Download Samples (e.g. Ensemble 8)http://jdk8.java.net/download.html9
  10. 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1310Ensemble in Mac App Store
  11. 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1311 11Get Pro JavaFX 2 Book ResourcesFirst chapter and all code samples availableat http://ProJavaFX2.com for free
  12. 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1312 12Visit Here: http://fxexperience.comTip: This site isauthored byOracle JavaFXEngineers, andoften containsnews about 3D
  13. 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1313Creating a User InterfaceThe MetronomeTransitionexample is in the Pro JavaFX 2code download
  14. 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1314Extend javafx.application.Application
  15. 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1315Override the Application start() Method
  16. 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1316Create a Scene
  17. 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1317Populate the Scene Graph
  18. 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1318Handle Events
  19. 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1319Call the Animation Methods
  20. 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1320Animate the Circle
  21. 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1321Bind UI Properties to Animation Status
  22. 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1322Setup and Show the Stage
  23. 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1323Some New Java Features in JDK 8■ Nashorn JavaScript Engine■ Date & Time API■ Bulk data operations for collections■ Lambda expressions and virtual extension methods23
  24. 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1324A Lambda Expression (Closure) is……a function that that may have parameters,an expression or block of code, optionallyreturning a value.24e -> anim.playFromStart()
  25. 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1325 25Event Handling w/Anon Inner ClassesAny interface that has exactly one abstract method is known as afunctional interface, and may be replaced by a lambda expression.
  26. 26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1326 26Replace with Lambda ExpressionThe type of the lambda is inferred by the compiler asEventHandler<ActionEvent> because the onAction() methodtakes an object of type EventHandler<ActionEvent>.Because EventHandler has a single method handle() the lambdaexpression must be an implementation of the handle() method.
  27. 27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1327 27Simplify the Lambda ExpressionThe parameter in this lambda expression must be anActionEvent, because that is the type specified by thehandle() method of the EventHandler interface.We can therefore simplify this lambda expressionbecause the parameter type is inferred.
  28. 28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1328 28Lose the ParenthesesWhen a lambda expression has a single parameter andits type is inferred, the parentheses are not required
  29. 29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1329 29Lose the BracesBecause the block of code in our lambda expressioncontains only one statement, we can lose the braces.
  30. 30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1330 30MetronomeTransition w/Lambdas
  31. 31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1331Blog Post with More Detailhttp://JavaFXpert.com/2013/02/mary-had-a-little-%CE%BB.html31
  32. 32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1332New JavaFX Features in JDK 8■ New Modern Theme: Modena■ JavaFX 3D■ Rich Text■ TreeTableView■ DatePicker■ Public API for CSS structure■ WebView Enhancements■ Embedded Support32
  33. 33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1333New Modern Theme: Modena33http://fxexperience.com/2013/03/modena-theme-update/
  34. 34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1334“JavaFX 3D gives you the ability to use 3D geometry,cameras, and lights in JavaFX.”JavaFX 3D
  35. 35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1335JavaFX 3D Application Example35http://fxexperience.com/2013/02/javafx-3d-early-access-available/
  36. 36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1336Mesh Geometry (3D Shapes)■ Predefined shapes■ Box■ Cylinder■ Sphere■ User-defined shapes■ Using TriangleMesh / MeshView36https://wikis.oracle.com/display/OpenJDK/SphereAndBox.java
  37. 37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1337 37Creating Primitive Shapes and Materials
  38. 38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13383D Materials and Textures■ PhongMaterial has these properties■ Ambient color■ Diffuse color, diffuse map■ Specular color, specular map■ Specular power■ Normal map■ Self-illumination map38https://wikis.oracle.com/display/OpenJDK/3D+Features
  39. 39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13393D Lights■ Lights are nodes in the scene graph■ PointLight■ AmbientLight■ Default light provided if no active lights39https://wikis.oracle.com/display/OpenJDK/3D+Features
  40. 40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1340 40Lights, Camera, Action!Tip: The camera is a node in thescene graph, so it is moveable
  41. 41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1341Rich Text■ Use Cases■ text editor ● code editor ● mixed style Labels, buttons, cells ●headings ● descriptions ● large textual content ● etc.■ Details■ TextFlow, a new layout container■ Text is just a node… so you can add effects, event handlers, andanimations■ You can also use CSS, FXML41https://wikis.oracle.com/display/OpenJDK/Rich+Text
  42. 42. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1342Rich Text Examples42
  43. 43. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1343TreeTableView■ Goal: reuse as many API, or API concepts, as possible from theTreeView and TableView controls API43https://wikis.oracle.com/display/OpenJDK/TreeTableView
  44. 44. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1344DatePicker44
  45. 45. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1345Public API for CSS structure■ CSS styling is one of the key features for JavaFX■ CSS has been implemented exclusively in private API(com.sun.javafx.css package)■ Tools (e.g. Scene Builder) require a CSS public API■ Developers will be able to define custom CSS styles45https://wikis.oracle.com/display/OpenJDK/CSS+API+to+support+custom+UI+Controls
  46. 46. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1346WebView Enhancements■ Nashorn JavaScript engine■ https://blogs.oracle.com/nashorn/entry/open_for_business■ WebSocket■ http://javafx-jira.kenai.com/browse/RT-14947■ Web Workers■ http://javafx-jira.kenai.com/browse/RT-978246
  47. 47. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1347Embedded Support■ JavaFX to be included in Oracle’s implementation of■ Java SE 8 (x86, x64, ARM)■ Java SE Embedded 8 (ARM)■ Java SE Embedded 8 will include a subset of the JavaFXfeatures to be released in the desktop version■ No WebView support■ No media support47
  48. 48. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1348RoadmapJavaFX20152013 2014JDK 8 (Q1 2014)• Lambda•JVM Convergence• JavaScript Interop• JavaFX 8– 3D API– Java SE Embedded support– Enhanced HTML5 support7uX• Java Flight Recorder in JDK• Native memory tracking• Java Discovery Protocol• App Store Packaging toolsJDK 9• Jigsaw• Interoperability• Optimizations• Cloud• Ease of Use• JavaFX JSRNetBeans IDE 7.3• New hints and refactoring• Scene Builder SupportNetBeans IDE 8• JDK 8 support• Scene Builder 2.0 supportScene Builder 2.0• JavaFX 8 support• Enhanced Java IDE supportNetBeans IDE 9• JDK 9 support• Scene Builder 3.0 supportSceneBuilder 3.0• JavaFX 9 supportApr CPU• Java ClientSecurityEnhancements2016JDK 8.1 (Q3 2014)• Deterministic G1• JMC 6• Improved JRE installer• App bundlingenhancementsJDK 8.2Scene Builder 1.1• Linux support
  49. 49. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1349Call to Action■ Download and play with JDK 8 / JavaFX 8 features■ Share your experiences with JavaFX community by bloggingand tweeting #JavaFX■ Send me james.weaver@oracle.com an RSS feed to the JavaFXcategory of your blog so I can include your posts onhttp://javafxcommunity.com49
  50. 50. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1350Questions?
  51. 51. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1351New JavaFX Features in JDK 8(after a gentle intro to app development with JavaFX)Jim WeaverJava Technology AmbassadorOracle Corporation@JavaFXpertjames.weaver@oracle.com
  52. 52. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1352
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×