javafx jumpstart @javaone 2016
TRANSCRIPT
JavaFXcanoo
About meJava Champion
JavaOne RockstarCanoo Engineering AG
JCP Expert GroupJUG Dortmund
Star Warswww.guigarage.com@hendrikEbbers canoo
Hello Worldwww.guigarage.com@hendrikEbbers canoo
Hello Worldwww.guigarage.com@hendrikEbbers canoo
JavaFX is PLAIN JAVANO JavaFX Script
Write it with any Java IDE
... or go oldschool
never use this one ;)
Hello Worldwww.guigarage.com@hendrikEbbers canoo
1 - Create a Class
2 - Extend Javafx.application.application
3 - Have Fun
Hello Worldwww.guigarage.com@hendrikEbbers canoo
publicclassHelloWorldextendsApplication{
@Overridepublicvoidstart(StageprimaryStage){StackPanemyPane=newStackPane(newButton("HelloWorld"));primaryStage.setScene(newScene(myPane));primaryStage.show();}
publicstaticvoidmain(String[]args){launch(args);}}
Hello Worldwww.guigarage.com@hendrikEbbers canoo
Stage
Scene
StackPane
Button
Scenegraph
contains
Hello Worldwww.guigarage.com@hendrikEbbers canoo
public class Demo extends javafx.application.Application { @Override public void init() {}
@Override public void start(javafx.stage.Stage stage) {}
@Override public void stop() {}
public static void main(String[] parameters) { launch(parameters); } }
application.init() application.start(Stage) application.stop()
stage.close()
stuck in the IDE
www.guigarage.com@hendrikEbbers canoo
stuck in the IDE
www.guigarage.com@hendrikEbbers canoo
Netbeans Project Eclipse Project
stuck in the IDE
www.guigarage.com@hendrikEbbers canoo
stuck in the IDE
www.guigarage.com@hendrikEbbers canoo
😥
😭
😱
😰😵
stuck in the IDE
www.guigarage.com@hendrikEbbers canoo
😥 😓 😨 😰 😵 😭 😱
stuck in the IDE
www.guigarage.com@hendrikEbbers canoo
?
Project management
www.guigarage.com@hendrikEbbers canoo
www.guigarage.com@hendrikEbbers canoo
Describe the application in an Environment independent way
Project management
www.guigarage.com@hendrikEbbers canoo
1 - Define Java Version in Build file
2 - Define Dependencies in Build File
I like to to this in a
static way… Project management
www.guigarage.com@hendrikEbbers canoo
JavaFX and Maven
Project management
a perfect match
www.guigarage.com@hendrikEbbers canoo
Project management
<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.guigarage</groupId><artifactId>javafx-application</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.source>1.8</maven.compiler.source> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties></project>
www.guigarage.com@hendrikEbbers canoo
You have to choose
Project management
www.guigarage.com@hendrikEbbers canoo
Native Builds
Project management
Providing a JAR to customers sucks
Since Java 8 we can go Native
EXE & DMG
www.guigarage.com@hendrikEbbers canoo
Native Builds
Project management
JavaPackager is part of JDKOracle Provides ANT supportMaven & Gradle Support by Community
www.guigarage.com@hendrikEbbers canoo
Native Builds
Project management
www.guigarage.com@hendrikEbbers canoo
Native Builds
Project management
simply add native content to your project
www.guigarage.com@hendrikEbbers canoo
Test Support
Project management
USe TestFX to write JavaFX test
Tests automatically boot your UI
Headless Tests supported
Build pipeline
Build pipeline
Deploying an productive app... from your local machine is like ...
Build pipeline
Deploying an productive app. . . from your local machine is like
Build pipeline
Deploying an productive app. . . from your local machine is like
Build pipeline
Deploying an productive app. . . from your local machine is like
Build pipeline
Deploying an productive app. . . from your local machine is like
Build pipeline
Just to make sure you get it ...
Build pipeline
Deploying an productive app. . . from your local machine is like
Build pipeline
Deploying an productive app. . . from your local machine is like
All together now
Build pipeline
Deploying an productive app... from a Build server is like ...
Build pipeline
Deploying an productive app. . . from your local machine is like
Build pipeline
Using a Build server is quite easyIt's really the same than for any other Java project
Remember: JavaFX == Java
choose your favorite
Build pipeline
Works for Open Source, TooIt only takes 5 minutes to setup a Travis Build for your GitHub repo
+
Build pipeline
Native BuildsYou need build notes for the different platforms
Build server
Linux build node
Mac build node
Windows build node
trigger builds
JavaFX on Mobile
www.guigarage.com@hendrikEbbers canoo
JavaFX MobileSimply Install IDE Plugin
Create a new Project
Run JavaFX on Mobile
www.guigarage.com@hendrikEbbers canoo
WAIT!DON'T We stuck in the IDE now????
JavaFX on Mobile
www.guigarage.com@hendrikEbbers canooGradle Build
questions?