Introduction to JavaFX. Tecniche di Programmazione A.A. 2012/2013

Similar documents
Web Services in Eclipse. Sistemi Informativi Aziendali A.A. 2012/2013

Per imparare a programmare bisogna programmare

Client-side programming with JavaScript. Laura Farinetti Dipartimento di Automatica e Informatica Politecnico di Torino laura.farinetti@polito.

Database access and JDBC. Tecniche di Programmazione A.A. 2013/2014

JavaFX Session Agenda

e(fx)clipse - JavaFX Tooling and Runtime

Autoboxing/Autounboxing

JavaFX Die neue UI- Technologie im JDK 8

JavaFX Mashups. Martin Gunnarsson, Pär Sikö, Jayway. fredag 26 oktober 12

Entwicklung mit JavaFX

CUSTOMER+ PURL Manager

6 th Annual EclipseCon Introduction to BIRT Report Development. John Ward

Tutorial: Time Of Day Part 2 GUI Design in NetBeans

G r a p h i c a l A p p l i c a t i o n D e v e l o p m e n t w i t h B o n i t a S t u d i o

Ad Hoc Reporting. Usage and Customization

Database Forms and Reports Tutorial

How To Create A Website Template On Sitefinity

Using NetBeans IDE for Desktop Development. Geertjan Wielenga

<Insert Picture Here> What's New in NetBeans IDE 7.2

Outline. 1.! Development Platforms for Multimedia Programming!

Eclipse 4 RCP application Development COURSE OUTLINE

e(fx)clipse - JavaFX Tooling

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Web Design in Nvu Workbook 1

<Insert Picture Here> Oracle Application Express 4.0

IOIO for Android Beginners Guide Introduction

Selenium Automation set up with TestNG and Eclipse- A Beginners Guide

RuleBender Tutorial

Software Development Kit

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

design coding monitoring deployment Java Web Framework for the Efficient Development of Enterprise Web Applications

How to Use the EPM Connector to Visualize BPC Data via SAP Crystal Dashboard Design (Xcelsius Dashboards)

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

Java SE 6 Update 10. la piattaforma Java per le RIA. Corrado De Bari. Sun Microsystems Italia Spa. Software & Java Ambassador

PA8: 2048 GUI (100 Points)

Developing NFC Applications on the Android Platform. The Definitive Resource

Creating Analyses and Dashboards Topic List Collapse All Topics Hide All Images Print

Developer Tutorial Version 1. 0 February 2015

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013


WebViewer User Guide. version PDFTron Systems, Inc. 1 of 13

Google Docs Basics Website:

WEB DEVELOPMENT IA & IB (893 & 894)

Android Environment SDK

Android Basic XML Layouts

An evaluation of JavaFX as 2D game creation tool

Using Spry Widgets. In This Chapter

e(fx)clipse - JavaFX Tooling and Runtime

Using Adobe Dreamweaver CS4 (10.0)

How to create pop-up menus

DIA Creating Charts and Diagrams

Jordan Jozwiak November 13, 2011

Oracle Business Intelligence Publisher: Create Reports and Data Models. Part 1 - Layout Editor

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc.

In this example, Mrs. Smith is looking to create graphs that represent the ethnic diversity of the 24 students in her 4 th grade class.

Appendix 2.1 Tabular and Graphical Methods Using Excel

The Eclipse Scout Book Version 3.9 (Kepler)

JBoss SOAP Web Services User Guide. Version: M5

Sabre Red Apps. Developer Toolkit Overview. October 2014

Eclipse installation, configuration and operation

This document covers version of BPMN2 Modeler, published November 15, 2013.

Spotfire v6 New Features. TIBCO Spotfire Delta Training Jumpstart

Eclipse with Mac OSX Getting Started Selecting Your Workspace. Creating a Project.

Android Basics. Xin Yang

Explore commands on the ribbon Each ribbon tab has groups, and each group has a set of related commands.

Generating Automated Test Scripts for AltioLive using QF Test

^/ CS> KRIS. JAMSA, PhD, MBA. y» A- JONES & BARTLETT LEARNING

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

Quick start. A project with SpagoBI 3.x

ADT Plugin for Eclipse

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

How To Contact The Author Introduction What You Will Need The Basic Report Adding the Parameter... 9

<Insert Picture Here> Web 2.0 Data Visualization with JSF. Juan Camilo Ruiz Senior Product Manager Oracle Development Tools

Fondamenti di Java. Introduzione alla costruzione di GUI (graphic user interface)

Windows Presentation Foundation

How to Create an Android Application using Eclipse on Windows 7

IDS 561 Big data analytics Assignment 1

... Introduction... 17

Chapter 19: XML. Working with XML. About XML

e(fx)clipse - JavaFX Tooling and Runtime

SAP's Integrated Development Environment for Java. Karl Kessler, SAP AG

Web Development I & II*

HTML5 Data Visualization and Manipulation Tool Colorado School of Mines Field Session Summer 2013

CaptainCasa. CaptainCasa Enterprise Client. CaptainCasa Enterprise Client. Feature Overview

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

Copyright combit GmbH ; Rev All rights reserved.

Working With Templates in Web Publisher. Contributed by Paul O Mahony Developer Program

Introduction to Eclipse

Dashcode User Guide. (Retired Document)

Manual for CKForms component Release 1.3.4

Implementation of ULC Visual Editor for Eclipse

Actuate Business Intelligence and Reporting Tools (BIRT)

MSWL Development & Tool. Eclipse IDE

Transcription:

Introduction to JavaFX Tecniche di Programmazione

Summary 1. About and History 2. Basic concepts 3. Minimal JavaFX Application 4. Resources 2

About and History Introduction to JavaFX

GUI in Java Graphic framework available in Java Swing Extremely powerful, many extensions available Complex to master, requires low-level handling Hard to create visually pleasing applications Alternatives available Most notable: SWT (Eclipse) Still cumbersome to master On a different Universe, web-based user interfaces became nicer and faster to create 4

JavaFX 1.0 forget it JavaFX 1 and JavaFX 2 are completely different Version 1 relied on a scripting language to describe scenes, with hooks to activate Java code JavaFX 1.x is now deprecated 5

JavaFX 2.x Redesigned from scratch The JavaFX 2.x framework is entirely written in Java For visual layout, an XML file may also be used (called FXML) Graphic appearance borrows from web-standard CSS style sheets UI programming is based on easy to handle events and bindings Oracle plans to deprecate Swing in favor of JavaFX 2 6

Getting and running JavaFX JavaFX is already included in Oracle JDK 7 Not in JDK 6.x Not in OpenJDK (beware, Linux users!) Recommended: JavaFX Scene Builder Eclipse: e(fx)clipse plugin, available in the Eclipse Marketplace Download links are in the course webpage 7

Basic concepts Introduction to JavaFX

Key concepts in JavaFX Stage: where the application will be displayed (e.g., a Windows window) Scene: one container of Nodes that compose one page of your application Node: an element in the Scene, with a visual appearance and an interactive behavior. Nodes may be hierarchically nested My best friend is the JavaFX JavaDoc API http://docs.oracle.com/javafx/2/api/index.html 9

Some Nodes (UI Form controls) 10

Some Parent Nodes (Layout panes) BorderPane (5-areas) Hbox, Vbox (linear sequence) StackPane (overlay all children) GridPane (row x columns) FlowPane (flowing boxes, wrap around) TilePane (flowpane with equally sized boxes) AnchorPane (magnetically attach nodes at corners or sides) 11

Some Nodes (Charts) 12

Nodes family 13 javafx.scene.node Parent Control ChoiceBox ComboBoxBase ColorPicker ComboBox Labeled ButtonBase Button CheckBox MenuButton ToggleButton Cell Label TitledPane ListView MenuBar Separator Slider TabPane TextInputControl TextArea TextField ToolBar TreeView Group Region Axis Chart Pane AnchorPane BorderPane FlowPane GridPane HBox StackPane TilePane VBox WebView Shape Arc Circle Line Polygon Polyline Rectangle Text Canvas Imageview Focus on Panes and Controls

And more coming 14

Empty JavaFX window public class Main extends Application { @Override public void start(stage stage) { Group root = new Group(); // the root is Group or Pane Scene scene = new Scene(root, 500, 500, Color.BLACK); stage.settitle("javafx Demo"); stage.setscene(scene); stage.show(); } } public static void main(string[] args) { launch(args); } 15

Adding some shape public class Main extends Application { @Override public void start(stage stage) { Group root = new Group(); Scene scene = new Scene(root, 500, 500, Color.BLACK); stage.settitle("javafx Demo"); Rectangle r = new Rectangle(25,25,250,250); r.setfill(color.blue); root.getchildren().add(r); } stage.setscene(scene); stage.show(); } 16

How to add scene content In Java code By creating and adding new Node subclasses Standard way, in Java (boring and error-prone) By using node Builder classes Programming pattern, later on In FXML By writing XML directly By using the Scene Editor And loading the FXML into the application 17

JavaFX Scene Builder 18

... FXML fragment <HBox id="hbox" alignment="center" spacing="15.0" AnchorPane.rightAnchor="23.0" AnchorPane.topAnchor="22.0"> <children> <Button id="button1" fx:id="newissue" onaction="#newissuefired text="new" /> <Button id="button1" fx:id="saveissue" onaction="#saveissuefired text="save" /> <Button id="button1" fx:id="deleteissue" onaction="#deleteissuefired" text="delete" /> </children> </HBox> <ImageView id="issuetrackinglite" layoutx="14.0" layouty="20.0"> <image> <Image url="@issuetrackinglite.png" preserveratio="true" smooth="true" /> </image> </ImageView>... 19

Building a scene from FXML public void start(stage stage) throws Exception { Parent root = FXMLLoader.load( getclass().getresource("circle.fxml")); } stage.settitle("circle Demo"); stage.setscene(new Scene(root, 500, 150)); stage.show(); 20

Resources Introduction to JavaFX

Resources Official http://www.oracle.com/us/technologies/java/fx/overview/index. html http://www.oracle.com/technetwork/java/javafx/overview/index.html Documents http://docs.oracle.com/javafx/ http://docs.oracle.com/javafx/2/api/index.html Blogs http://fxexperience.com/ http://www.learnjavafx.typepad.com/weblog/ http://community.java.net/community/javafx 22

Licenza d uso Queste diapositive sono distribuite con licenza Creative Commons Attribuzione - Non commerciale - Condividi allo stesso modo (CC BY-NC-SA) Sei libero: di riprodurre, distribuire, comunicare al pubblico, esporre in pubblico, rappresentare, eseguire e recitare quest'opera di modificare quest'opera Alle seguenti condizioni: Attribuzione Devi attribuire la paternità dell'opera agli autori originali e in modo tale da non suggerire che essi avallino te o il modo in cui tu usi l'opera. Non commerciale Non puoi usare quest'opera per fini commerciali. Condividi allo stesso modo Se alteri o trasformi quest'opera, o se la usi per crearne un'altra, puoi distribuire l'opera risultante solo con una licenza identica o equivalente a questa. http://creativecommons.org/licenses/by-nc-sa/3.0/ 23