- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
Explain the JavaFX Application structure
In general, a JavaFX application will have three major components namely Stage, Scene and Nodes as shown in the following diagram.
A stage (a window) contains all the objects of a JavaFX application. It is represented by Stage class of the package javafx.stage. You have to call the show() method to display the contents of a stage.
A scene graph is a data structure similar to a tree, in modern graphical applications, it is a collection of nodes. In a JavaFX application the javafx.scene.The scene class holds all the contents of a scene graph.
While creating a scene it is mandatory to specify the root node.
In an instance, the scene object is added to only one stage.
A node is a visual/graphical primitive object of a JavaFX application.
2D and 3D geometric objects (circle, sphere, etc.), UI control objects (button, checkbox, etc.), Container/layout objects (Border Pane, Grid Pane, etc.), media element objects (audio, video, image objects, etc.) are (some) examples of nodes in JavaFX.
Each node in the scene graph has a single parent, and the node which does not contain any parents is known as the root node. In the same way, every node has one or more children, and the node without children is termed as leaf node; a node with children is termed as a branch node.
The following are various kinds of root nodes in a JavaFX application.
Group − A group node is a collective node that contains a list of children nodes. Whenever the group node is rendered, all its child nodes are rendered in order. Any transformation, effect state applied to the group will be applied to all the child nodes.
Region − It is the base class of all the JavaFX Node-based UI Controls, such as Chart, Pane and Control.
WebView − This node manages the web engine and displays its contents.
Leaf Node − The node without child nodes is known as the leaf node. For example, Rectangle, Ellipse, Box, ImageView, MediaView are examples of leaf nodes.
- Related Articles
- Explain the life cycle of a JavaFX Application
- Explain the features of JavaFX
- How to create a JavaFX Basic Application?
- OpenCV JavaFX application to alter the sharpness of an image
- Explain JavaFX Scene Graph
- Explain the structure of the hand.
- Explain the structure of a Flower.
- Explain the Properties of 2D objects in JavaFX
- Explain the properties of 3D object in JavaFX?
- Explain the ISDN services and its structure.
- Explain the working and application of a sonar.
- Explain the Union operation on 2D shapes in JavaFX
- Explain the Intersect operation on 2D shapes in JavaFX
- Explain the Subtract operation on 2D shapes in JavaFX
- Explain the Fill property of 2D shapes in JavaFX