SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Scripting with Java FX
Agenda
What is Java FX?
Why Java FX?
The 10 Minute Tutorial
Java FX Demo!
What To Do/Where To Go
Introduction: What is Java FX?
“JavaFX Script is a highly productive scripting language that
enables content developers to create rich media and content
for deployment on Java environments. JavaFX Script is a
declarative, statically-typed programming language. It has firstclass functions, declarative syntax, list-comprehensions, and
incremental dependency-based evaluation. It can make direct
calls to Java APIs that are on the platform.”
--https://openjfx.dev.java.net/
Why Java FX?
• Writing GUIs is hard (and annoying)
> Yes, Matisse helps quite a bunch, but...
> There are still too many listeners.
Why Java FX?
• Writing GUIs is hard (and annoying)
> Yes, Matisse helps quite a bunch, but...
> There are still too many listeners.

• GUIs by default are ugly
> A hierarchy of rectangular “grey boxes” (not limited to Java!)
> Not as snazzy as Flash websites
Why Java FX?
• Writing GUIs is hard (and annoying)
> Yes, Matisse helps quite a bunch, but...
> There are still too many listeners.

• GUIs by default are ugly
> A hierarchy of rectangular “grey boxes” (not limited to Java!)
> Not as snazzy as Flash websites

• Java 2D provides much what is needed, but...
> It is rather difficult to use for this purpose
> It does not have “compositional” behavior

Java FX's declarative syntax, combining Swing-like user-interface
widgets with compositional, Java 2D-like functionality makes writing
flashy graphical user interfaces easy!
Java FX: The 10 Minute Tutorial
class HelloWorldModel {
attribute saying: String;
}

Class definition with
single String attribute

var model = HelloWorldModel {
saying: "Hello Campus"
};

Instance of the class
called “model” which
initializes string

var win = Frame {
title: bind "{model.saying} JavaFX"
width: 200
content: TextField {
value: bind model.saying
}
visible: true
};

Frame with a single
text field. Frame's title
and text field's value is
bound to model's
attribute.
Java FX: The 10 Minute Tutorial
import java.lang.StringIndexOutOfBoundsException;

Defining

operation substring(s:String, n:Number): String { operations (i.e.
try {
methods)
return s.substring(n);
} catch (e:StringIndexOutOfBoundsException) {
throw “sorry, index out of bounds”;
}
}

Calling Java methods
Can throw any object
you like
Java FX: The 10 Minute Tutorial
var x = [1,2,3];
insert 10 into x;
insert 12 before x[1];
delete x[. == 12];
delete x[. >= 3];
insert 5 after x[. == 1];
insert 13 as first into x;
delete x;

Array Initialization
yields [1, 2, 3, 10]
yields [1, 12, 2, 3, 10]
yields [1, 2, 3, 10]
yields [1, 2]
yields [1, 5, 2]
yields [13, 1, 5, 2]
yields []

function factors(n) {
return select i from i in [1..n/2] where n % i == 0;
}

Database-like Queries
for Arrays!
Java FX: The 10 Minute Tutorial
class X {
attribute nums: Number*;
}
trigger on new X {
insert [3,4] into this.nums;
}

Object creation trigger
Array insertion trigger
Array replacement
trigger

trigger on insert num into X.nums {
System.out.println("just inserted {num} into X.nums at
position {indexof num}");
}
trigger on X.num[oldValue] = newValue {
System.out.println("X.num: just replaced {oldValue} with
{newValue}");
}
Java FX: The 10 Minute Tutorial
import javafx.ui.canvas.*;
import javafx.ui.*;

Canvas object for
arbitrary drawing

Canvas {
content: Group {
transform: [rotate(20,0,0)]
content:
[Rect {
x: 20
y: 20
height: 80
width: 300
...
},
Ellipse {
cx: 150
cy: 80
...
},
}]
}
}

Group objects together
Transform groups
Declarative 2D
Graphics
demo
Java FX

What to
Do

• Download Java FX & IDE
Plugins for Netbeans or
Eclipse
• Join OpenJFX Java.net
Project
• Do Java FX Tutorials
• Participate on Java FX
Forums
• Create something cool!

http://openjfx.dev.java.net
Java FX Resources
• Java FX Project Site: http://openjfx.dev.java.net
> Java.net: Download early versions of Java FX
> IDE Plugins, Tutorials, Forums, FAQs
> “Getting Started With the JavaFX Script Language”
> “JavaFX Script 2D Graphics Tutorial”
> “The JavaFX Script Programming Language Reference”

• Planet FX Wiki: http://jfx.wikia.com/wiki/Main_Page
> Open-source documentation site for Java FX

• Chris Oliver's Blog: http://blogs.sun.com/chrisoliver/
> Latest news, other informal information
> Source code for lots of demos (Space Invaders, Calculator)

• Sun's Java FX Site:
http://www.sun.com/software/javafx/
> Sun Microsystems official product page
Scripting with Java FX
http://openjfx.dev.java.net

THANK YOU!

Contenu connexe

Tendances

Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
 
JavaScript in Object-Oriented Way
JavaScript in Object-Oriented WayJavaScript in Object-Oriented Way
JavaScript in Object-Oriented Way
Chamnap Chhorn
 
Introduction to nodejs
Introduction to nodejsIntroduction to nodejs
Introduction to nodejs
James Carr
 

Tendances (19)

Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
 
JavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UX
 
Lecture 5 javascript
Lecture 5 javascriptLecture 5 javascript
Lecture 5 javascript
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScript
 
Type script, for dummies
Type script, for dummiesType script, for dummies
Type script, for dummies
 
Object Oriented Javascript
Object Oriented JavascriptObject Oriented Javascript
Object Oriented Javascript
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
 
Node ppt
Node pptNode ppt
Node ppt
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
Java Script Best Practices
Java Script Best PracticesJava Script Best Practices
Java Script Best Practices
 
Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)Nashorn: JavaScript that doesn’t suck (ILJUG)
Nashorn: JavaScript that doesn’t suck (ILJUG)
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricks
 
JavaScript in Object-Oriented Way
JavaScript in Object-Oriented WayJavaScript in Object-Oriented Way
JavaScript in Object-Oriented Way
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Introduction to nodejs
Introduction to nodejsIntroduction to nodejs
Introduction to nodejs
 
All You Need to Know About Type Script
All You Need to Know About Type ScriptAll You Need to Know About Type Script
All You Need to Know About Type Script
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 

Similaire à Scripting with Java FX - Cédric Tabin - December 2007

Why Node.js
Why Node.jsWhy Node.js
Why Node.js
guileen
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
QUONTRASOLUTIONS
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans
Fabrizio Giudici
 

Similaire à Scripting with Java FX - Cédric Tabin - December 2007 (20)

JavaFX introduction
JavaFX introductionJavaFX introduction
JavaFX introduction
 
Java Fx Overview Tech Tour
Java Fx Overview Tech TourJava Fx Overview Tech Tour
Java Fx Overview Tech Tour
 
Presentation - Course about JavaFX
Presentation - Course about JavaFXPresentation - Course about JavaFX
Presentation - Course about JavaFX
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008EuRuKo JRuby Talk 2008
EuRuKo JRuby Talk 2008
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S Guide
 
JavaFX Your Way: Building JavaFX Applications with Alternative Languages
JavaFX Your Way: Building JavaFX Applications with Alternative LanguagesJavaFX Your Way: Building JavaFX Applications with Alternative Languages
JavaFX Your Way: Building JavaFX Applications with Alternative Languages
 
JavaFX and Scala in the Cloud
JavaFX and Scala in the CloudJavaFX and Scala in the Cloud
JavaFX and Scala in the Cloud
 
Don't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFXDon't panic in Fortaleza - ScalaFX
Don't panic in Fortaleza - ScalaFX
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
 
Scala in a nutshell
Scala in a nutshellScala in a nutshell
Scala in a nutshell
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
Core java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutionsCore java over view basics introduction by quontra solutions
Core java over view basics introduction by quontra solutions
 
JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]JavaFX 2.0 With Alternative Languages [Portuguese]
JavaFX 2.0 With Alternative Languages [Portuguese]
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 
Rich Internet Applications con JavaFX e NetBeans
Rich Internet Applications  con JavaFX e NetBeans Rich Internet Applications  con JavaFX e NetBeans
Rich Internet Applications con JavaFX e NetBeans
 
From Java 6 to Java 7 reference
From Java 6 to Java 7 referenceFrom Java 6 to Java 7 reference
From Java 6 to Java 7 reference
 

Plus de JUG Lausanne

Reverse engineering Java et contournement du mécanisme de paiement inapp Android
Reverse engineering Java et contournement du mécanisme de paiement inapp AndroidReverse engineering Java et contournement du mécanisme de paiement inapp Android
Reverse engineering Java et contournement du mécanisme de paiement inapp Android
JUG Lausanne
 

Plus de JUG Lausanne (20)

Introduction aux algorithmes génétiques
Introduction aux algorithmes génétiquesIntroduction aux algorithmes génétiques
Introduction aux algorithmes génétiques
 
Développer un moteur d'exécution symbolique en partant de rien
Développer un moteur d'exécution symbolique en partant de rienDévelopper un moteur d'exécution symbolique en partant de rien
Développer un moteur d'exécution symbolique en partant de rien
 
Reverse engineering Java et contournement du mécanisme de paiement inapp Android
Reverse engineering Java et contournement du mécanisme de paiement inapp AndroidReverse engineering Java et contournement du mécanisme de paiement inapp Android
Reverse engineering Java et contournement du mécanisme de paiement inapp Android
 
Exemple d'IOT et ML avec Android, Cassandra et Spark
Exemple d'IOT et ML avec Android, Cassandra et SparkExemple d'IOT et ML avec Android, Cassandra et Spark
Exemple d'IOT et ML avec Android, Cassandra et Spark
 
Play! chez Zaptravel - Nicolas Martignole - December 2012
Play! chez Zaptravel - Nicolas Martignole - December 2012Play! chez Zaptravel - Nicolas Martignole - December 2012
Play! chez Zaptravel - Nicolas Martignole - December 2012
 
Playframework Realtime Web - Guillaume Bort & Sadek Drobi - December 2012
Playframework Realtime Web - Guillaume Bort & Sadek Drobi - December 2012Playframework Realtime Web - Guillaume Bort & Sadek Drobi - December 2012
Playframework Realtime Web - Guillaume Bort & Sadek Drobi - December 2012
 
CloudBees - Sacha Labourey - May 2011
CloudBees - Sacha Labourey - May 2011CloudBees - Sacha Labourey - May 2011
CloudBees - Sacha Labourey - May 2011
 
Apache Camel - Stéphane Kay - April 2011
Apache Camel - Stéphane Kay - April 2011Apache Camel - Stéphane Kay - April 2011
Apache Camel - Stéphane Kay - April 2011
 
Session dédiée à l'analyse de la qualité du code Java - Cyril Picat - Februar...
Session dédiée à l'analyse de la qualité du code Java - Cyril Picat - Februar...Session dédiée à l'analyse de la qualité du code Java - Cyril Picat - Februar...
Session dédiée à l'analyse de la qualité du code Java - Cyril Picat - Februar...
 
OpenDS - Ludovic Poitou - December 2010
OpenDS - Ludovic Poitou - December 2010OpenDS - Ludovic Poitou - December 2010
OpenDS - Ludovic Poitou - December 2010
 
Spring Batch - Julien Jakubowski - November 2010
Spring Batch - Julien Jakubowski - November 2010Spring Batch - Julien Jakubowski - November 2010
Spring Batch - Julien Jakubowski - November 2010
 
Infinispan - Galder Zamarreno - October 2010
Infinispan - Galder Zamarreno - October 2010Infinispan - Galder Zamarreno - October 2010
Infinispan - Galder Zamarreno - October 2010
 
No Sql - Olivier Mallassi - September 2010
No Sql - Olivier Mallassi - September 2010No Sql - Olivier Mallassi - September 2010
No Sql - Olivier Mallassi - September 2010
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
 
Introduction à Scala - Michel Schinz - January 2010
Introduction à Scala - Michel Schinz - January 2010Introduction à Scala - Michel Schinz - January 2010
Introduction à Scala - Michel Schinz - January 2010
 
Introduction Groovy / Grails - Cyril Picat - December 2009
Introduction Groovy / Grails - Cyril Picat - December 2009Introduction Groovy / Grails - Cyril Picat - December 2009
Introduction Groovy / Grails - Cyril Picat - December 2009
 
Initiation aux tests fonctionnels - Philippe Kernevez - October 2009
Initiation aux tests fonctionnels - Philippe Kernevez - October 2009Initiation aux tests fonctionnels - Philippe Kernevez - October 2009
Initiation aux tests fonctionnels - Philippe Kernevez - October 2009
 
Sonar - Freddy Mallet - April 2009
Sonar - Freddy Mallet - April 2009Sonar - Freddy Mallet - April 2009
Sonar - Freddy Mallet - April 2009
 
Maven2 - Philippe Kernevez - March 2009
Maven2 - Philippe Kernevez - March 2009Maven2 - Philippe Kernevez - March 2009
Maven2 - Philippe Kernevez - March 2009
 
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
Introduction à Google Web Toolkit (GWT) - Philippe Kernevez - February 2009
 

Dernier

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Scripting with Java FX - Cédric Tabin - December 2007

  • 2. Agenda What is Java FX? Why Java FX? The 10 Minute Tutorial Java FX Demo! What To Do/Where To Go
  • 3. Introduction: What is Java FX? “JavaFX Script is a highly productive scripting language that enables content developers to create rich media and content for deployment on Java environments. JavaFX Script is a declarative, statically-typed programming language. It has firstclass functions, declarative syntax, list-comprehensions, and incremental dependency-based evaluation. It can make direct calls to Java APIs that are on the platform.” --https://openjfx.dev.java.net/
  • 4. Why Java FX? • Writing GUIs is hard (and annoying) > Yes, Matisse helps quite a bunch, but... > There are still too many listeners.
  • 5. Why Java FX? • Writing GUIs is hard (and annoying) > Yes, Matisse helps quite a bunch, but... > There are still too many listeners. • GUIs by default are ugly > A hierarchy of rectangular “grey boxes” (not limited to Java!) > Not as snazzy as Flash websites
  • 6. Why Java FX? • Writing GUIs is hard (and annoying) > Yes, Matisse helps quite a bunch, but... > There are still too many listeners. • GUIs by default are ugly > A hierarchy of rectangular “grey boxes” (not limited to Java!) > Not as snazzy as Flash websites • Java 2D provides much what is needed, but... > It is rather difficult to use for this purpose > It does not have “compositional” behavior Java FX's declarative syntax, combining Swing-like user-interface widgets with compositional, Java 2D-like functionality makes writing flashy graphical user interfaces easy!
  • 7. Java FX: The 10 Minute Tutorial class HelloWorldModel { attribute saying: String; } Class definition with single String attribute var model = HelloWorldModel { saying: "Hello Campus" }; Instance of the class called “model” which initializes string var win = Frame { title: bind "{model.saying} JavaFX" width: 200 content: TextField { value: bind model.saying } visible: true }; Frame with a single text field. Frame's title and text field's value is bound to model's attribute.
  • 8. Java FX: The 10 Minute Tutorial import java.lang.StringIndexOutOfBoundsException; Defining operation substring(s:String, n:Number): String { operations (i.e. try { methods) return s.substring(n); } catch (e:StringIndexOutOfBoundsException) { throw “sorry, index out of bounds”; } } Calling Java methods Can throw any object you like
  • 9. Java FX: The 10 Minute Tutorial var x = [1,2,3]; insert 10 into x; insert 12 before x[1]; delete x[. == 12]; delete x[. >= 3]; insert 5 after x[. == 1]; insert 13 as first into x; delete x; Array Initialization yields [1, 2, 3, 10] yields [1, 12, 2, 3, 10] yields [1, 2, 3, 10] yields [1, 2] yields [1, 5, 2] yields [13, 1, 5, 2] yields [] function factors(n) { return select i from i in [1..n/2] where n % i == 0; } Database-like Queries for Arrays!
  • 10. Java FX: The 10 Minute Tutorial class X { attribute nums: Number*; } trigger on new X { insert [3,4] into this.nums; } Object creation trigger Array insertion trigger Array replacement trigger trigger on insert num into X.nums { System.out.println("just inserted {num} into X.nums at position {indexof num}"); } trigger on X.num[oldValue] = newValue { System.out.println("X.num: just replaced {oldValue} with {newValue}"); }
  • 11. Java FX: The 10 Minute Tutorial import javafx.ui.canvas.*; import javafx.ui.*; Canvas object for arbitrary drawing Canvas { content: Group { transform: [rotate(20,0,0)] content: [Rect { x: 20 y: 20 height: 80 width: 300 ... }, Ellipse { cx: 150 cy: 80 ... }, }] } } Group objects together Transform groups Declarative 2D Graphics
  • 12. demo
  • 13. Java FX What to Do • Download Java FX & IDE Plugins for Netbeans or Eclipse • Join OpenJFX Java.net Project • Do Java FX Tutorials • Participate on Java FX Forums • Create something cool! http://openjfx.dev.java.net
  • 14. Java FX Resources • Java FX Project Site: http://openjfx.dev.java.net > Java.net: Download early versions of Java FX > IDE Plugins, Tutorials, Forums, FAQs > “Getting Started With the JavaFX Script Language” > “JavaFX Script 2D Graphics Tutorial” > “The JavaFX Script Programming Language Reference” • Planet FX Wiki: http://jfx.wikia.com/wiki/Main_Page > Open-source documentation site for Java FX • Chris Oliver's Blog: http://blogs.sun.com/chrisoliver/ > Latest news, other informal information > Source code for lots of demos (Space Invaders, Calculator) • Sun's Java FX Site: http://www.sun.com/software/javafx/ > Sun Microsystems official product page
  • 15. Scripting with Java FX http://openjfx.dev.java.net THANK YOU!