JAVA CLIENTS AND
JAVAFX
THE DEFINITIVE GUIDE
Stephen Chin
JFrog Developer Relations
Johan Vos
Gluon Mobile Java CEO
@steveonjava @johanvos
@steveonjava
https://jfrog.com/shownotes/
@johanvos@johanvos
HOW I PICTURED MYSELF DURING
THE APOCOLYPSE
@steveonjava
https://jfrog.com/shownotes/
@johanvos@johanvos
HOW I ACTUALLY LOOK DURING THE
PANDEMIC
@steveonjava
https://jfrog.com/shownotes/
@johanvos
HISTORY OF JAVAFX
2006: F3 Form Follows Function
2008: JavaFX 1.0 Initial Release of JavaFX
2011: JavaFX 2.0 Java API (JavaFX Script Removed)
2012: JavaFX 2.2 JavaFX Bundled with JavaSE 7u6
2014: JavaFX 8 JDK Integration
2018: JDK 11 JavaFX Removed from the JDK
@steveonjava
https://jfrog.com/shownotes/
@johanvos@johanvos
@steveonjava
https://jfrog.com/shownotes/
@johanvos
GLUON MOBILE
• JavaFX 11, 12, 13, and 14 builds
• SceneBuilder GUI Builder
• JavaFX on iOS and Android
@steveonjava
https://jfrog.com/shownotes/
@johanvos
JFrog.com/shownotes
● Today’s Slides
● The Video of this Talk
● Nintendo Switch Raffle
● 5 T-Shirts for LJC members
Bit.ly/LJCJFrog
@steveonjava
https://jfrog.com/shownotes/
@johanvos
@steveonjava
https://jfrog.com/shownotes/
@johanvos
JAVAFX USE CASES
@steveonjava
https://jfrog.com/shownotes/
@johanvos
MINT TRAINING AND RESOURCE MANAGEMENT
@steveonjava
https://jfrog.com/shownotes/
@johanvos
NASA DEEP SPACE TRAJECTORY EXPLORER
@steveonjava
https://jfrog.com/shownotes/
@johanvos@johanvos
DEVOXX CONFERENCE MOBILE APPLICATION
@steveonjava
https://jfrog.com/shownotes/
@johanvos
SPACEFX GAME
@steveonjava
https://jfrog.com/shownotes/
@johanvos
JAVAFX 3D
@steveonjava
https://jfrog.com/shownotes/
@johanvos
MESH GEOMETRY (3D SHAPES)
■ Predefined shapes
■ Box
■ Cylinder
■ Sphere
■ User-defined shapes
■ Using TriangleMesh / MeshView
15
@steveonjava
https://jfrog.com/shownotes/
@johanvos
UV MAPPING TEXTURES TO SHAPES
16
Tip: A texture is a 2D image to
be mapped on a 3D surface
@steveonjava
https://jfrog.com/shownotes/
@johanvos
3D LIGHTS
■ Lights are nodes in the scene graph
■ PointLight
■ AmbientLight
■ Default light provided if no active lights
17
@steveonjava
https://jfrog.com/shownotes/
@johanvos
FXYZ
• Built-in shapes
• Lights, materials, camera
• FXyz 3D https://github.com/FXyz/FXyz
@steveonjava
https://jfrog.com/shownotes/
@johanvos
1. PACKAGE YOUR PLATFORM
@steveonjava
https://jfrog.com/shownotes/
@johanvos
PACKAGES KEEP GETTING LARGER
@steveonjava
https://jfrog.com/shownotes/
@johanvos
PACKAGING JAVAFX APPLICATIONS
• Works, but not recommended:
• ¨FAT JAR¨ – Package all your dependencies and run on command line
• Recommended:
• jlink – Requires modular apps
• jpackage – Available now in Java 14
• New options:
• Native image – Use Graal to create a native application
• OpenWebStart – Open source version of Web Start for modern JDKs by Karakun
@steveonjava
https://jfrog.com/shownotes/
@johanvos
CREATE STATIC IMAGES
https://www.gluonhq.co
m
@steveonjava
https://jfrog.com/shownotes/
@johanvos
2. TARGET MOBILE FIRST
@steveonjava
https://jfrog.com/shownotes/
@johanvos
MOBILE WEB TRAFFIC
0.7% 2.9%
6.1%
10.7%
16.2%
27.1%
35.1%
43.6%
50.3%
52.2%
2009 2010 2011 2012 2013 2014 2015 2016 2017 2018
Mobile Web Traffic
@steveonjava
https://jfrog.com/shownotes/
@johanvos
JAVAFX ON MOBILE
• Native-image from GraalVM
• OpenJDK 11+ & OpenJFX 11+
• Mac OS X, Linux, iOS, Android
• Gradle/Maven plugins
• IDE Support for IntelliJ, Eclipse, and NetBeans
• https://github.com/gluonhq/client-samples
@steveonjava
https://jfrog.com/shownotes/
@johanvos
3. BUILD FOR THE CLOUD
@steveonjava
https://jfrog.com/shownotes/
@johanvosETEOBOARD
@steveonjava
https://jfrog.com/shownotes/
@johanvos
JAVAFX ON THE CLOUD
• The Weather App
• Don’t reveal your credentials!
RemoteFunctionObject functionObject =
RemoteFunctionBuilder.create("weather")
.param("q", CITY)
.object();
@steveonjava
https://jfrog.com/shownotes/
@johanvos
FROM JAVAFX EXPERTS TO THE COMMUNITY
@steveonjava
https://jfrog.com/shownotes/
@johanvos
HOW CAN YOU INFLUENCE THE ROADMAP
• Contribute
• OpenJFX code: https://github.com/openjdk/jfx
• Project leads: Kevin Rushforth (Oracle) and Johan Vos (Gluon)
• 100% open source, clear development rules (Reviewer, Committer)
Getting started:
• https://openjfx.io
• Mobile samples: https://github.com/gluonhq/client-samples
@steveonjava
https://jfrog.com/shownotes/
@johanvos@johanvos
Bit.ly/LJCJFrog
@steveonjava
https://jfrog.com/shownotes/
@johanvos@johanvos
Q&A

Java Clients and JavaFX - Presented to LJC

Editor's Notes

  • #16 In JavaFX 3D there are three predefined shapes (Box, Cylinder, and Sphere). You can also create your own user-defined shapes, which consist of a mesh of triangles and a MeshView to be able to view the TriangleMesh.
  • #17 A technique known as UV mapping is used to map a 2D image onto a 3D shape.
  • #18 Now that we’ve explored the first feature in JavaFX 3D (mesh geometry), we’ll take a look at other two features mentioned earlier (cameras and lighting). Note to presenter: This demo may be seen by running the FX8-3DAPI project.