SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
Introduction of JavaFx
Prem Chand Mali
About Me
SCJP/OCJP - Oracle Certified Java Programmer
MCP:70-480 - Specialist certification in HTML5
with JavaScript and CSS3 Exam
Skills : Java, Swings, Springs,
Hibernate, JavaFX, Jquery,
prototypeJS, ExtJS.
Connect Me :
Facebook : https://www.facebook.com/prem.c.mali
LinkedIn: http://www.linkedin.com/in/premmali
Twitter: https://twitter.com/prem_mali
Google+ : https://plus.google.com/106150245941317924019/about/p/pub
Contact Me :
Email : premchandm@mindfiresolutions.com / prem.c.mali@gmail.com
Skype: mfsi_premchandm
Agenda


JavaFx Introduction.



Requirements for JavaFX application development.



HelloWorld application with Netbeans.



Introduction of Application, stage and scene key classes.



UI controls



Layout Panes



Event Handling



Q&A
JavaFx Introduction
JavaFx is a software platform for creating and delivering
rich internet application (RIAs) that can run across a wide
variety of devices.


Before version 2.0 of JavaFx, it was JavaFX was scripting
language to build JavaFX application.


JavaFx 2.0 and later is now implemented as a native Java
library and JavaFX Script has been scrapped by Oracle, but
development is being continue in the Visage project.


JavaFx 2.x does not support the Solaris operating system
or mobile phones; however as plans to integrate JavaFX to
Java SE embedded 8, JavaFx for ARM processors is
currently in developer preview phase.

Requirements for JavaFX application development
JavaFX 2.2.5 libraries are installed with JDK 7u11 for all
supported operating systems. Note that Apple's Java SE
implementation is not supported with JavaFX.


For JDK 6 you need to use standalone JavaFX 2.2.5
installation.


Browser support IE7, 8, 9, 10, firefox 3.6+, chrome latest
and safari 5.1+




Graphics support NVIDIA, ATI, Intel.



You can use Netbeans, Eclipse, IntealiJ and etc.
HelloWorld in JavaFX with Netbeans
Example is created on Netbeans 7.1.2


Goto → File Menu and choose New Project

In the JavaFX application category, choose JavaFX
Application. Click Next




Name the project HelloWorld and click Finish

You will have HelloWorld.java class where you can put
following code and run the application.

HelloWorld in JavaFX with Netbeans
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class main extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
//Setting the Title of window.
primaryStage.setTitle("Hello World!");
HelloWorld in JavaFX with Netbeans
//Creating label and setting the text.
Label lbl = new Label();
lbl.setText("Say 'Hello World'");
//Creating the stackpane for layout and adding label
into it.
StackPane root = new StackPane();
root.getChildren().add(lbl);
//Creating and setting the scene.
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
}
Introduction of following key classes.
Application

Stage

Scene

Application
Every JavaFx application needs to extend this abstract
class. This is the entry point of the JavaFx application.


JavaFx runtime does the following, in order, whenever an
application id launched.
- Constructs an instance of the specified Application class.
- Calls the init() method.
- Calls the start(javafx.stage.Stage) method.
- Waits for the application to finish, which happens when
either of the following occur:
a.) the application calls Platform.exit()
b.) the last window has been closed and the implicitExit
attribute on Platform is true.
- Calls the stop() method


start method is abstract and must be overridden. The init
and stop methods have concrete implementations that do
nothing.

Application
Values can be passed to JavaFx application. Application
parameters are available by calling the getParameters()
method from the init() method, or any time after the init
method has been called.


JavaFX creates an application thread for running the
application start method, processing input events, and
running animation timelines. Creation of JavaFX Scene and
Stage objects as well as modification of scene graph
operations to live objects (those objects already attached
to a scene) must be done on the JavaFX application thread.

Stage
The JavaFX Stage class is the top level JavaFX container.
The primary Stage is constructed by the platform.
Additional Stage objects may be constructed by the
application.


Stage objects must be constructed and modified on the
JavaFX Application Thread.


A stage can optionally have an owner Window. When a
window is a stage's owner, it is said to be the parent of that
stage. When a parent window is closed, all its descendant
windows are closed. The same chained behavior applied
for a parent window that is iconified. A stage will always be
on top of its parent window. The owner must be initialized
before the stage is made visible.

Scene
The JavaFX Scene class is the container for all content in a
scene graph. The background of the scene is filled as
specified by the fill property.


The application must specify the root Node for the scene
graph by setting the root property.




A scene graph is a tree data structure.
JavaFx UI Controls
The JavaFX UI controls are built by using nodes in the
scene graph. Therefore, the controls can use the visually
rich features of the JavaFX platform. Here are following
controls.


- Label
- Button
- Radio Button
- Toggle Button
- Checkbox
- Choice Box
- Text Field
- Password Field
- Scroll Bar
- Scroll Pane
- List View
- Table View
- Tree View
- Combo Box
JavaFx UI Controls
- Separator
- Slider
- Progress Bar and Progress Indicator
- Hyperlink
- Tooltip
- HTML Editor
- Titled Pane and Accordion
- Menu
- Color Picker
- Pagination Control
- File Chooser
Layouts
- BorderPane
- HBox
- VBox
- StackPane
- GridPane
- FlowPane
- AnchorPane
- TilePane
Event Handling
An event represents an occurrence of something of
interest to the application, such as a mouse being moved
or a key being pressed.


- Mouse Event
- Key Event
- Touch Event
- Gesture
Q&A

Mais conteúdo relacionado

Mais procurados

Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handlingkamal kotecha
 
Java Presentation
Java PresentationJava Presentation
Java Presentationpm2214
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in javaAdil Mehmoood
 
Event handling
Event handlingEvent handling
Event handlingswapnac12
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
graphics programming in java
graphics programming in javagraphics programming in java
graphics programming in javaAbinaya B
 
Java: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh EditionJava: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh Editionmoxuji
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programmingElizabeth Thomas
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)Manisha Keim
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSaba Ameer
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Javayht4ever
 

Mais procurados (20)

Java Swing
Java SwingJava Swing
Java Swing
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Swing and AWT in java
Swing and AWT in javaSwing and AWT in java
Swing and AWT in java
 
Event handling
Event handlingEvent handling
Event handling
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Java threads
Java threadsJava threads
Java threads
 
graphics programming in java
graphics programming in javagraphics programming in java
graphics programming in java
 
Java: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh EditionJava: The Complete Reference, Eleventh Edition
Java: The Complete Reference, Eleventh Edition
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Java Strings
Java StringsJava Strings
Java Strings
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 

Destaque

Rich Enterprise Applications with JavaFX
Rich Enterprise Applications with JavaFXRich Enterprise Applications with JavaFX
Rich Enterprise Applications with JavaFXMax Katz
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXTweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXBruno Borges
 
Building RIA Applications with JavaFX
Building RIA Applications with JavaFXBuilding RIA Applications with JavaFX
Building RIA Applications with JavaFXMax Katz
 
Pro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFXPro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFXStephen Chin
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Bruno Borges
 

Destaque (7)

JavaFx
JavaFxJavaFx
JavaFx
 
Rich Enterprise Applications with JavaFX
Rich Enterprise Applications with JavaFXRich Enterprise Applications with JavaFX
Rich Enterprise Applications with JavaFX
 
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFXTweet4Beer - Beertap powered by Java goes IoT and JavaFX
Tweet4Beer - Beertap powered by Java goes IoT and JavaFX
 
Building RIA Applications with JavaFX
Building RIA Applications with JavaFXBuilding RIA Applications with JavaFX
Building RIA Applications with JavaFX
 
Pro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFXPro JavaFX Platform - Building Enterprise Applications with JavaFX
Pro JavaFX Platform - Building Enterprise Applications with JavaFX
 
JavaFX
JavaFXJavaFX
JavaFX
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 

Semelhante a Introduction to JavaFX

UNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdfUNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdfSakkaravarthiS1
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)Alexander Casall
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Stephen Chin
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1rajivmordani
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Programming with JavaFX
Programming with JavaFXProgramming with JavaFX
Programming with JavaFXFulvio Corno
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In ActionHazem Saleh
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemAlexander Casall
 
Presentation - Course about JavaFX
Presentation - Course about JavaFXPresentation - Course about JavaFX
Presentation - Course about JavaFXTom Mix Petreca
 
Javafxpressentation 140524053934-phpapp01 (1)
Javafxpressentation 140524053934-phpapp01 (1)Javafxpressentation 140524053934-phpapp01 (1)
Javafxpressentation 140524053934-phpapp01 (1)ssuser4f9de3
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFxMohd Shamweel
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Stephen Chin
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSGunnar Hillert
 

Semelhante a Introduction to JavaFX (20)

UNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdfUNIT 5-JavaFX Event Handling, Controls and Components.pdf
UNIT 5-JavaFX Event Handling, Controls and Components.pdf
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)
 
Java fx
Java fx Java fx
Java fx
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
 
Jsf tutorial
Jsf tutorialJsf tutorial
Jsf tutorial
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
Programming with JavaFX
Programming with JavaFXProgramming with JavaFX
Programming with JavaFX
 
Apache Cordova In Action
Apache Cordova In ActionApache Cordova In Action
Apache Cordova In Action
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and Ecosystem
 
Os Haase
Os HaaseOs Haase
Os Haase
 
Presentation - Course about JavaFX
Presentation - Course about JavaFXPresentation - Course about JavaFX
Presentation - Course about JavaFX
 
Javafxpressentation 140524053934-phpapp01 (1)
Javafxpressentation 140524053934-phpapp01 (1)Javafxpressentation 140524053934-phpapp01 (1)
Javafxpressentation 140524053934-phpapp01 (1)
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFx
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
 
Node.js vs Play Framework
Node.js vs Play FrameworkNode.js vs Play Framework
Node.js vs Play Framework
 
Modular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJSModular Test-driven SPAs with Spring and AngularJS
Modular Test-driven SPAs with Spring and AngularJS
 

Mais de Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Último

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Introduction to JavaFX

  • 2. About Me SCJP/OCJP - Oracle Certified Java Programmer MCP:70-480 - Specialist certification in HTML5 with JavaScript and CSS3 Exam Skills : Java, Swings, Springs, Hibernate, JavaFX, Jquery, prototypeJS, ExtJS. Connect Me : Facebook : https://www.facebook.com/prem.c.mali LinkedIn: http://www.linkedin.com/in/premmali Twitter: https://twitter.com/prem_mali Google+ : https://plus.google.com/106150245941317924019/about/p/pub Contact Me : Email : premchandm@mindfiresolutions.com / prem.c.mali@gmail.com Skype: mfsi_premchandm
  • 3. Agenda  JavaFx Introduction.  Requirements for JavaFX application development.  HelloWorld application with Netbeans.  Introduction of Application, stage and scene key classes.  UI controls  Layout Panes  Event Handling  Q&A
  • 4. JavaFx Introduction JavaFx is a software platform for creating and delivering rich internet application (RIAs) that can run across a wide variety of devices.  Before version 2.0 of JavaFx, it was JavaFX was scripting language to build JavaFX application.  JavaFx 2.0 and later is now implemented as a native Java library and JavaFX Script has been scrapped by Oracle, but development is being continue in the Visage project.  JavaFx 2.x does not support the Solaris operating system or mobile phones; however as plans to integrate JavaFX to Java SE embedded 8, JavaFx for ARM processors is currently in developer preview phase. 
  • 5. Requirements for JavaFX application development JavaFX 2.2.5 libraries are installed with JDK 7u11 for all supported operating systems. Note that Apple's Java SE implementation is not supported with JavaFX.  For JDK 6 you need to use standalone JavaFX 2.2.5 installation.  Browser support IE7, 8, 9, 10, firefox 3.6+, chrome latest and safari 5.1+   Graphics support NVIDIA, ATI, Intel.  You can use Netbeans, Eclipse, IntealiJ and etc.
  • 6. HelloWorld in JavaFX with Netbeans Example is created on Netbeans 7.1.2  Goto → File Menu and choose New Project In the JavaFX application category, choose JavaFX Application. Click Next   Name the project HelloWorld and click Finish You will have HelloWorld.java class where you can put following code and run the application. 
  • 7. HelloWorld in JavaFX with Netbeans import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class main extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { //Setting the Title of window. primaryStage.setTitle("Hello World!");
  • 8. HelloWorld in JavaFX with Netbeans //Creating label and setting the text. Label lbl = new Label(); lbl.setText("Say 'Hello World'"); //Creating the stackpane for layout and adding label into it. StackPane root = new StackPane(); root.getChildren().add(lbl); //Creating and setting the scene. primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); } }
  • 9. Introduction of following key classes. Application  Stage  Scene 
  • 10. Application Every JavaFx application needs to extend this abstract class. This is the entry point of the JavaFx application.  JavaFx runtime does the following, in order, whenever an application id launched. - Constructs an instance of the specified Application class. - Calls the init() method. - Calls the start(javafx.stage.Stage) method. - Waits for the application to finish, which happens when either of the following occur: a.) the application calls Platform.exit() b.) the last window has been closed and the implicitExit attribute on Platform is true. - Calls the stop() method  start method is abstract and must be overridden. The init and stop methods have concrete implementations that do nothing. 
  • 11. Application Values can be passed to JavaFx application. Application parameters are available by calling the getParameters() method from the init() method, or any time after the init method has been called.  JavaFX creates an application thread for running the application start method, processing input events, and running animation timelines. Creation of JavaFX Scene and Stage objects as well as modification of scene graph operations to live objects (those objects already attached to a scene) must be done on the JavaFX application thread. 
  • 12. Stage The JavaFX Stage class is the top level JavaFX container. The primary Stage is constructed by the platform. Additional Stage objects may be constructed by the application.  Stage objects must be constructed and modified on the JavaFX Application Thread.  A stage can optionally have an owner Window. When a window is a stage's owner, it is said to be the parent of that stage. When a parent window is closed, all its descendant windows are closed. The same chained behavior applied for a parent window that is iconified. A stage will always be on top of its parent window. The owner must be initialized before the stage is made visible. 
  • 13. Scene The JavaFX Scene class is the container for all content in a scene graph. The background of the scene is filled as specified by the fill property.  The application must specify the root Node for the scene graph by setting the root property.   A scene graph is a tree data structure.
  • 14. JavaFx UI Controls The JavaFX UI controls are built by using nodes in the scene graph. Therefore, the controls can use the visually rich features of the JavaFX platform. Here are following controls.  - Label - Button - Radio Button - Toggle Button - Checkbox - Choice Box - Text Field - Password Field - Scroll Bar - Scroll Pane - List View - Table View - Tree View - Combo Box
  • 15. JavaFx UI Controls - Separator - Slider - Progress Bar and Progress Indicator - Hyperlink - Tooltip - HTML Editor - Titled Pane and Accordion - Menu - Color Picker - Pagination Control - File Chooser
  • 16. Layouts - BorderPane - HBox - VBox - StackPane - GridPane - FlowPane - AnchorPane - TilePane
  • 17. Event Handling An event represents an occurrence of something of interest to the application, such as a mouse being moved or a key being pressed.  - Mouse Event - Key Event - Touch Event - Gesture
  • 18. Q&A