javafx 1 - research school of computer science · introduction to software systems...

4
Introduction to Software Systems 1110/1140/1510/6710 Intro to JavaFX JavaFX 1 X1

Upload: lelien

Post on 17-May-2018

228 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: JavaFX 1 - Research School of Computer Science · Introduction to Software Systems 1110/1140/1510/6710 JavaFX JavaFX ... Java API – For older JDKs, JavaFX is separately bundled,

Introduction to Software Systems 1110/1140/1510/6710

Intro to JavaFX

JavaFX 1 X1

Page 2: JavaFX 1 - Research School of Computer Science · Introduction to Software Systems 1110/1140/1510/6710 JavaFX JavaFX ... Java API – For older JDKs, JavaFX is separately bundled,

Introduction to Software Systems 1110/1140/1510/6710

JavaFX

JavaFX

•  Designed for rich client applications –  Graphics, UI’s, video, audio, etc.

•  Java APIs, integrated with Java 8 –  Not to be confused with JavaFX 1.x, which is a scripting language, not a

Java API –  For older JDKs, JavaFX is separately bundled, and must be separately

installed

•  Replaces Swing •  JavaFX HelloWorld

5

X1

Page 3: JavaFX 1 - Research School of Computer Science · Introduction to Software Systems 1110/1140/1510/6710 JavaFX JavaFX ... Java API – For older JDKs, JavaFX is separately bundled,

Introduction to Software Systems 1110/1140/1510/6710

JavaFX

JavaFX

•  Extend javafx.application.Application –  Override the start() method

•  Stage–  Think of it as a window

•  Scene–  Container for a scene graph

•  StackPane–  Organizer of nodes in scene graph –  Others include FlowPane, TilePane, GridPane, etc

6

X1

Page 4: JavaFX 1 - Research School of Computer Science · Introduction to Software Systems 1110/1140/1510/6710 JavaFX JavaFX ... Java API – For older JDKs, JavaFX is separately bundled,

Introduction to Software Systems 1110/1140/1510/6710

JavaFX

Java FX Scene Graph Tree of nodes, with a single ‘branch’ at the root •  branch (may have children, eg Group, Region) •  leaf (may not have children, eg Rectangle, Circle)

7

Copyright Oracle (http://docs.oracle.com/javafx/2/scenegraph/jfxpub-scenegraph.htm)

X1