SlideShare a Scribd company logo
1 of 38
Download to read offline
Presented By: Mansi Babbar
Demo on JavaFX
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Mute
Please keep your window on mute
Avoid Disturbance
Avoid leaving your window
unmuted after asking a question
Agenda
01 What is JavaFX?
03 Features of JavaFX
04 JavaFX Application Structure
Why JavaFX?
02
05 Components of JavaFX
06 JavaFX by Example
07 Demo on JavaFX
What is JavaFX?
What is JavaFX?
● Library used to build Rich Internet Applications (RIA).
● Applications can run consistently across multiple platforms.
● Applications can run on various devices.
● Can develop GUI applications effectively with rich content.
Why JavaFX?
Need for JavaFX
● No need of using various libraries to add features such as Media, UI controls,
Web, 2D and 3D, etc. JavaFX includes all these features in a single library.
● Developers can access the existing features of Java libraries such as Swing.
● Compared to Swing, it provides a clear and clean architecture and features
many enhancements: styling, event management, transitions, scene graph, etc.
● Provides all the professional Java tooling required to debug, analyze, profile,
and log a client application.
Need for JavaFX
● Enables a simple app-like installation on the client side, without any
prerequisites.
● Provides a rich set of graphics and media APIs.
● Provides the possibility of developing up-to-date user interfaces with
animations, multitouch, etc. It also provides interfaces to combine graphics
animation and UI control.
Experiences with JavaFX
● Stability
● Standard control library
● Extensibility
● Third-party libraries
● Development process
● Performance
● Support
Features of JavaFX
Features of JavaFX
● Written in Java
● Support FXML
● Provides WebView
● Swing Interoperability
● Built-in UI controls
● CSS like Styling
● Swing Interoperability
● Integrated Graphics library
● Support Media
● Provides JavaScript Engine
JavaFX Application
Structure
JavaFX Application Structure
JavaFX Application Structure
1. To construct the UI:
a. Prepare a scene graph.
b. Construct a scene, with the root node of the scene graph.
c. Setup the stage with the constructed scene.
Stage
Stage
● A stage or window contains all the objects of a JavaFX application.
● It is represented by Stage class of the package javafx.stage.
● The primary stage is created by the platform itself.
● A stage has two parameters determining its position namely Width and Height.
● It is divided as Content Area and Decorations (Title Bar and Borders).
● There are five types of stages available −
○ Decorated
○ Undecorated
○ Transparent
○ Unified
○ Utility
● You have to call the show() method to display the contents of a stage.
Scene
Scene
● A scene represents the physical contents of a JavaFX application.
● It contains all the contents of a scene graph.
● The class Scene of the package javafx.scene represents the scene object.
● At an instance, the scene object is added to only one stage.
● Size of the scene can be specified by passing its dimensions (height and width)
along with the root node to its constructor.
Scene Graph
Scene Graph
● A scene graph is a tree-like data structure (hierarchical) representing the
contents of a scene.
● All visual components (controls, layouts etc.) are part of scene graph.
● Scene graph components must be attached to a scene to be displayed, and
that scene must be attached to a stage for the whole scene to be visible.
● The total object graph of all the controls, layouts etc. attached to a scene is
called the scene graph.
Nodes
Nodes
● A node is a visual/graphical object of a scene graph.
● All nodes are subclasses of a JavaFX class called javafx.scene.Node.
● A node may include −
○ Geometrical (Graphical) objects (2D and 3D).
○ UI Controls such as − Button, Checkbox, Choice Box, Text Area, etc.
○ Containers (Layout Panes) such as Border Pane, Grid Pane, Flow Pane, etc.
○ Media elements such as Audio, Video and Image Objects.
Type of Nodes
● Root Node − The first node of scene graph is known as the root node.
● Branch Node/Parent Node − Node with child nodes.
○ The abstract class named Parent of the package javafx.scene is the base class
of all the parent nodes.
○ Those parent nodes will be of the following types −
■ Group
■ Region
■ WebView
● Leaf Node − Node without child nodes.
○ For example - Rectangle, Ellipse, Box, ImageView, MediaView, etc.
Components of
JavaFX
Controls
● Provide some kind of control functionality inside a JavaFX application.
● For a control to be visible it must be attached to the scene graph of some
Scene object.
● Nested inside some JavaFX layout component that manages the layout of
controls relative to each other.
● Event handlers can be added to controls to perform some event when the
control is fired.
Controls
JavaFX contains the following controls:
● Accordion
● Button
● CheckBox
● ChoiceBox
● ColorPicker
● ComboBox
● DatePicker
● ListView
● Menu
● MenuBar
● PasswordField
● ProgressBar
● RadioButton
● Slider
● SplitMenuButton
● SplitPane
● TableView
● TabPane
● TextArea
● TextField
● TitledPane
● ToolBar
● TreeTableView
● TreeView
● Label
● Spinner
● ToggleButton
Layouts
● Components which contains other components inside them.
● Manages the layout of the components nested inside it.
● Called parent components because they contain child components.
● Layout components are subclasses of the JavaFX class javafx.scene.Parent.
● Must be attached to the scene graph of some Scene object to be visible.
Layout components
● BorderPane
● StackPane
● TilePane
● GridPane
● AnchorPane
● TextFlow
● JavaFX contains the following layout components:
● Group
● Region
● Pane
● HBox
● VBox
● FlowPane
Other Components of JAVAFX
● Charts
○ JavaFX comes with a set of built-in ready-to-use chart components to
avoid coding charts from scratch every time you need a basic chart.
● WebView
○ JavaFX contains a WebView component which is capable of showing web
pages (HTML5, CSS etc.).
● Audio
○ JavaFX contains features that makes it easy to play audio in JavaFX
applications. This is typically useful in games or educational applications.
Other Components of JAVAFX
● Video
○ JavaFX contains features that makes it easy to play video in JavaFX
applications. This is typically useful in streaming applications, games or
educational applications.
● 2D Graphics
○ JavaFX contains features that makes it easy to draw 2D graphics on the
screen.
● 3D Graphics
○ JavaFX contains features that makes it easy to draw 3D graphics on the
screen.
JavaFX by Example
JavaFX by Example
JavaFX is huge, with 36 packages. These are the commonly-used packages:
● javafx.application: JavaFX application
● javafx.stage: top-level container
● javafx.scene: scene and scene graph.
● javafx.scene.*: control, layout, shape, etc.
● javafx.event: event handling
● javafx.animation: animation
JavaFX by Example
JavaFX by Example
Step 1: Prepare a scene graph.
JavaFX by Example
Step 2: Construct a scene, with the root node of the scene graph.
JavaFX by Example
Step 3: Setup the stage with the constructed scene.
Demo on
JavaFX
Thank You !

More Related Content

Similar to Demo on JavaFX

Similar to Demo on JavaFX (20)

20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
 
DesktopApps.pptx
DesktopApps.pptxDesktopApps.pptx
DesktopApps.pptx
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Chapter 1-Note.docx
Chapter 1-Note.docxChapter 1-Note.docx
Chapter 1-Note.docx
 
Java fx
Java fxJava fx
Java fx
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
unit1.pptx
unit1.pptxunit1.pptx
unit1.pptx
 
Java fx
Java fxJava fx
Java fx
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Tycs advance java sem 5 unit 1,2,3,4 (2017)
Tycs advance java sem 5 unit 1,2,3,4 (2017)Tycs advance java sem 5 unit 1,2,3,4 (2017)
Tycs advance java sem 5 unit 1,2,3,4 (2017)
 
Java Swing
Java SwingJava Swing
Java Swing
 
java intro.pptx
java intro.pptxjava intro.pptx
java intro.pptx
 
JavaFX in Action Part I
JavaFX in Action Part IJavaFX in Action Part I
JavaFX in Action Part I
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
JavaFX: A Rich Internet Application (RIA) Development Platform
JavaFX: A Rich Internet Application (RIA) Development PlatformJavaFX: A Rich Internet Application (RIA) Development Platform
JavaFX: A Rich Internet Application (RIA) Development Platform
 
JavaFX Presentation
JavaFX PresentationJavaFX Presentation
JavaFX Presentation
 

More from Knoldus Inc.

Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingKnoldus Inc.
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionKnoldus Inc.
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxKnoldus Inc.
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptxKnoldus Inc.
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfKnoldus Inc.
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxKnoldus Inc.
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingKnoldus Inc.
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesKnoldus Inc.
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxKnoldus Inc.
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAKnoldus Inc.
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Knoldus Inc.
 

More from Knoldus Inc. (20)

Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
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...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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?
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Demo on JavaFX

  • 1. Presented By: Mansi Babbar Demo on JavaFX
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Mute Please keep your window on mute Avoid Disturbance Avoid leaving your window unmuted after asking a question
  • 3. Agenda 01 What is JavaFX? 03 Features of JavaFX 04 JavaFX Application Structure Why JavaFX? 02 05 Components of JavaFX 06 JavaFX by Example 07 Demo on JavaFX
  • 5. What is JavaFX? ● Library used to build Rich Internet Applications (RIA). ● Applications can run consistently across multiple platforms. ● Applications can run on various devices. ● Can develop GUI applications effectively with rich content.
  • 7. Need for JavaFX ● No need of using various libraries to add features such as Media, UI controls, Web, 2D and 3D, etc. JavaFX includes all these features in a single library. ● Developers can access the existing features of Java libraries such as Swing. ● Compared to Swing, it provides a clear and clean architecture and features many enhancements: styling, event management, transitions, scene graph, etc. ● Provides all the professional Java tooling required to debug, analyze, profile, and log a client application.
  • 8. Need for JavaFX ● Enables a simple app-like installation on the client side, without any prerequisites. ● Provides a rich set of graphics and media APIs. ● Provides the possibility of developing up-to-date user interfaces with animations, multitouch, etc. It also provides interfaces to combine graphics animation and UI control.
  • 9. Experiences with JavaFX ● Stability ● Standard control library ● Extensibility ● Third-party libraries ● Development process ● Performance ● Support
  • 11. Features of JavaFX ● Written in Java ● Support FXML ● Provides WebView ● Swing Interoperability ● Built-in UI controls ● CSS like Styling ● Swing Interoperability ● Integrated Graphics library ● Support Media ● Provides JavaScript Engine
  • 14. JavaFX Application Structure 1. To construct the UI: a. Prepare a scene graph. b. Construct a scene, with the root node of the scene graph. c. Setup the stage with the constructed scene.
  • 15. Stage
  • 16. Stage ● A stage or window contains all the objects of a JavaFX application. ● It is represented by Stage class of the package javafx.stage. ● The primary stage is created by the platform itself. ● A stage has two parameters determining its position namely Width and Height. ● It is divided as Content Area and Decorations (Title Bar and Borders). ● There are five types of stages available − ○ Decorated ○ Undecorated ○ Transparent ○ Unified ○ Utility ● You have to call the show() method to display the contents of a stage.
  • 17. Scene
  • 18. Scene ● A scene represents the physical contents of a JavaFX application. ● It contains all the contents of a scene graph. ● The class Scene of the package javafx.scene represents the scene object. ● At an instance, the scene object is added to only one stage. ● Size of the scene can be specified by passing its dimensions (height and width) along with the root node to its constructor.
  • 20. Scene Graph ● A scene graph is a tree-like data structure (hierarchical) representing the contents of a scene. ● All visual components (controls, layouts etc.) are part of scene graph. ● Scene graph components must be attached to a scene to be displayed, and that scene must be attached to a stage for the whole scene to be visible. ● The total object graph of all the controls, layouts etc. attached to a scene is called the scene graph.
  • 21. Nodes
  • 22. Nodes ● A node is a visual/graphical object of a scene graph. ● All nodes are subclasses of a JavaFX class called javafx.scene.Node. ● A node may include − ○ Geometrical (Graphical) objects (2D and 3D). ○ UI Controls such as − Button, Checkbox, Choice Box, Text Area, etc. ○ Containers (Layout Panes) such as Border Pane, Grid Pane, Flow Pane, etc. ○ Media elements such as Audio, Video and Image Objects.
  • 23. Type of Nodes ● Root Node − The first node of scene graph is known as the root node. ● Branch Node/Parent Node − Node with child nodes. ○ The abstract class named Parent of the package javafx.scene is the base class of all the parent nodes. ○ Those parent nodes will be of the following types − ■ Group ■ Region ■ WebView ● Leaf Node − Node without child nodes. ○ For example - Rectangle, Ellipse, Box, ImageView, MediaView, etc.
  • 25. Controls ● Provide some kind of control functionality inside a JavaFX application. ● For a control to be visible it must be attached to the scene graph of some Scene object. ● Nested inside some JavaFX layout component that manages the layout of controls relative to each other. ● Event handlers can be added to controls to perform some event when the control is fired.
  • 26. Controls JavaFX contains the following controls: ● Accordion ● Button ● CheckBox ● ChoiceBox ● ColorPicker ● ComboBox ● DatePicker ● ListView ● Menu ● MenuBar ● PasswordField ● ProgressBar ● RadioButton ● Slider ● SplitMenuButton ● SplitPane ● TableView ● TabPane ● TextArea ● TextField ● TitledPane ● ToolBar ● TreeTableView ● TreeView ● Label ● Spinner ● ToggleButton
  • 27. Layouts ● Components which contains other components inside them. ● Manages the layout of the components nested inside it. ● Called parent components because they contain child components. ● Layout components are subclasses of the JavaFX class javafx.scene.Parent. ● Must be attached to the scene graph of some Scene object to be visible.
  • 28. Layout components ● BorderPane ● StackPane ● TilePane ● GridPane ● AnchorPane ● TextFlow ● JavaFX contains the following layout components: ● Group ● Region ● Pane ● HBox ● VBox ● FlowPane
  • 29. Other Components of JAVAFX ● Charts ○ JavaFX comes with a set of built-in ready-to-use chart components to avoid coding charts from scratch every time you need a basic chart. ● WebView ○ JavaFX contains a WebView component which is capable of showing web pages (HTML5, CSS etc.). ● Audio ○ JavaFX contains features that makes it easy to play audio in JavaFX applications. This is typically useful in games or educational applications.
  • 30. Other Components of JAVAFX ● Video ○ JavaFX contains features that makes it easy to play video in JavaFX applications. This is typically useful in streaming applications, games or educational applications. ● 2D Graphics ○ JavaFX contains features that makes it easy to draw 2D graphics on the screen. ● 3D Graphics ○ JavaFX contains features that makes it easy to draw 3D graphics on the screen.
  • 32. JavaFX by Example JavaFX is huge, with 36 packages. These are the commonly-used packages: ● javafx.application: JavaFX application ● javafx.stage: top-level container ● javafx.scene: scene and scene graph. ● javafx.scene.*: control, layout, shape, etc. ● javafx.event: event handling ● javafx.animation: animation
  • 34. JavaFX by Example Step 1: Prepare a scene graph.
  • 35. JavaFX by Example Step 2: Construct a scene, with the root node of the scene graph.
  • 36. JavaFX by Example Step 3: Setup the stage with the constructed scene.