2. Introduction
• JavaFX, an “umbrella” for RIA
– JavaFX Script
– Desktop runtime
– JavaFX Mobile
– More to come (design tools?)
• NetBeans, an IDE
– Java and other languages
3. Context
• Will compete with
– Adobe's Flash/Flex/Air
– Microsoft Silverlight
• Based on the Java Virtual Machine
• Upcoming “Consumer JRE”
– See “Java 6 Update N”
4. It's what you're thinking...
It is intended to make Applets!
(among others)
6. JavaFX Script
• Object oriented
• Declarative
• Statically typed
• Can access the whole Java Runtime
– Comes with runtime extensions
• Currently interpreted
– Compiler coming soon
7. An example
import javafx.ui.*;
Frame {
title: "Hello World JavaFX"
width: 200
height: 50
content: Label {
text: "Hello World"
}
visible: true
}
8. Procedural fashion too
var win = new Frame();
win.title = "Hello World JavaFX";
win.width = 200;
var label = new Label();
label.text = "Hello World";
win.content = label;
win.visible = true;
9. Model / View / Controller
• MVC is a foundation, of course
• JavaFX allows to minimize the
boilerplate code between M and VC
• Binding
– Incremental
– Bidirectional
10. Binding
class HelloWorldModel {
attribute saying: String;
}
var model = HelloWorldModel {
saying: "Hello World"
};
Frame {
title: "Hello World JavaFX"
width: 200
content: Label {
text: bind model.saying
}
visible: true
};
19. Steps
• Get introduced to NetBeans
• Create model classes
• Create and bind some UI element
• Events
• Advanced stuff (search)
• Integration with other tiers
26. Search (array query)
• “List comprehensions”
– Create a list out of another list
– With criteria (e.g. filtering)
–
• select n*n from n in [1..100]
27. Search (array query)
select indexof track + 1
from album in albums,
track in album.tracks
where track == album.title;
function factors(n)
{
return select i from i in [1..n/2]
where n % i == 0;
}
28. In our case
TextField
{
value: "Search"
onChange: operation (string: String)
{
personListModel.selectedPerson =
(select indexof person
from person in
personListModel.personFactory.all
where person.secondName == string)[0];
}
}
29. Talking to other tiers
• JavaFX uses the Java Runtime...
• ... you can use whatever you need
– RMI, Spring Remoting, SOAP, Corba...
• Only pay attention to the footprint
– What will be in the “Customer JRE”?