2. Introduction
Senior Consultant for Citytech, Inc.
Software consultancy specializing in Java Enterprise Application Development
Sun Preferred Solution Provider for JavaFX
Located here in Chicago
3. What is JavaFX?
•Platform for developing Rich Internet Applications
•Runs on the Java Platform
•Consists of:
•Runtimes for Desktop, Mobile, and TV
•SDK (APIs, javafxc, etc.)
•Declarative Language (JavaFX Script)
•JavaFX is purely client side technology
11. JavaFX and Java: BFF
JavaFX compiles down to Java bytecode
JavaFX can call into Java and (somewhat) vice versa
JavaFX classes can extend Java classes or interfaces
Many shared language features: classes, exception handling, access
modifiers, package structure, and data types.
12. JavaFX Promotes “Ease of Development”
…and you can‟t spell “Ease of Development” without “Develop”[er]
13. Modern Language Features
Expression-based Language (most things return a value)
Declarative Syntax
Type Inference
Data Binding
Mixins
Closures/first-class functions
Triggers
Ranges
Extra Datatypes
• Duration (5s, 5000ms)
• Sequences
14. public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame("Swing Frame");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
JButton button = new JButton("Click me!");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Clicked!");
}
});
panel.add(button);
frame.add(panel, BorderLayout.CENTER);
frame.setSize(new Dimension(300, 100));
frame.setVisible(true);
}
}
Java
21. Type Inference
Boolean b = new Boolean (false);
var b = false;
or…
var b:Boolean = false;
Java
JavaFX
22. Arrays vs Sequences
int[] zeroToNine = new int[10];
for (int i = 0; i < 10; i++) {
zeroToNine[i] = i;
}
var zeroToNine = for (i in [0..<10]) i;
or…
var zeroToNine = [0..9];
Java
JavaFX
23. Sequence Slicing with Predicates
> var zeroToNine = [0..9];
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
> var onlyOdds = zeroToNine[i | i mod 2 == 1];
[ 1, 3, 5, 7, 9 ]
60. The Future
Next Release: Early „10
More Controls
CSS Styling of controls
Faster scenegraph
Designer Tool (Composer?)
(This image is likely subject to copyright)
64. Bonus Final Thoughts: It‟s all about Usability
“The basic advice regarding response times has been about the same
for thirty years:
•0.1 second is about the limit for having the user feel that the system is
reacting instantaneously, meaning that no special feedback is necessary
except to display the result
•1.0 second is about the limit for the user's flow of thought to stay
uninterrupted, even though the user will notice the delay. Normally, no
special feedback is necessary during delays of more than 0.1 but less than
1.0 second, but the user does lose the feeling of operating directly on the
data”
- Jakob Nielsen (noted Usability Expert)