
Quick Contact
Java Tutorial
- What is Java?
- History of Java
- Hello Java Program
- Features of Java
- Basic Syntax
- Java Setup
- Data Types in Java
- Java Variables
- Operators in Java
- JVM
- Java If-else Statement
- Switch Case Statement
- Java Loops
- Do-While Loop
- Java While Loop
- Continue Statement
- Break Statement in Java
- Constructors in Java
- Oops Concept in Java
- Features of OOPs
- Inheritance
- Exeception handeling
- Aggregation (HAS-A relationship) in Java
- Method Overriding in Java
- Method Overloading
- Java Static Keyword
- Java This Keyword
- Java Final Keyword
- Polymorphism
- Static Binding and Dynamic Binding
- Abstract class in Java
- Access Modifiers in Java
- Difference between abstract class and interface
- Interface in Java
- Garbage Collection in Java
- Java Package
- Encapsulation
- Serialization and Deserialization in Java
- Java Inner Classes
- Java Applets
- Multithreading in Java
- Thread Priorities in Java
- Thread Creation
- Inter Thread Communication
- Wrapper Classes in Java
- Java Input Output
- Java AWT Introduction
- Java Layout Manager
- Java Layout Policy
- Java AWT Events
- Collection Framework
- Collection Framework List Interface
- Swing in Java
- Swing Utility Classes
- Swing Layout Managers
- Java JDBC
- Hibernate Framework Overview – Architecture and Basics
Springboot
- Spring Environment Setup
- Spring Boot CRUD REST API Project using IntelliJ IDEA | Postman | MySQL
- Dockerizing Spring Boot Application | Spring Boot Docker Tutorial
- spring-boot-restapidocumentation with swagger
- Spring Boot HttpClient Overview
- Apache HttpClient POST HTTP Request Example
- Apache HttpClient PUT HTTP Request Example
- Apache HttpClient DELETE HTTP Request Example
- Apache HttpClient HTML Form POST Request Example
- Spring Boot JSP Exampl
- Deploying Spring Boot WAR file with JSP to Tomcat
- Spring Boot Annotations
- Spring Core Annotations
- Spring MVC Annotations with Examples
- Spring Scheduling Annotations
- Spring - Java-based Container Configuration
- Spring Java Based Configuration Example
Hibernate
- Hibernate 5 hello world
- Hibernate- One to One Unidirectional Mapping Annotation Example
- Hibernate - Batch Processing
- Hibernate - Interceptors
- Hibernate 5 - Create, Read, Update and Delete (CRUD) Operations Example
- Hibernate Transaction Management
- Hibernate One to Many Unidirectional Mapping Example
- Hibernate One to Many Bidirectional Mapping Example
- Hibernate Many to Many Annotation Mapping Example
- Hibernate Primary KeyJoin Column
- Hibernate First Level Cache with Example
- Hibernate XML Configuration Example with Maven + Eclipse + MySQL Database
- Hibernate Java Configuration Example
- JPA 2 with Hibernate 5 Bootstrapping Example
- JPA and Hibernate Cascade Types
- Hibernate/JPA - Primary Key Generation
- Hibernate 5 - Enum Type Mapping Example
- Hibernate Component Mapping
- Hibernate Object States – Transient,Persistent and Detached
- Hibernate 5 - Save an Entity Example
- Hibernate 5 - Persist an Entity Example
- Hibernate 5 - saveOrUpdate() Method Example
- Hibernate 5 - get(), load() and byId() Method Examples
- Hibernate 5 - merge() Example
- Hibernate 5 - Delete or Remove an Entity Example
- Hibernate 5 - load() Method Example
- Hibernate Session Interface Methods
- Hibernate Session.clear() Method Example
- Introduction Of Java strutes to Architecture
- Struts 2 - Architecture
- Struts 2 - Configuration Files
- Struts 2 - Actions
- Struts 2 - Interceptors
- Struts 2 - Results & Result Types
- Struts 2 - Value Stack/OGNL
- Struts 2 - File Uploading
- Struts 2 - Database Access
- Struts 2 - Validations Framework
JAVA FX
- JavaFX Tutorial
- Introduction to JavaFX Pane
- JavaFX Popup
- JavaFX group
- JavaFX Controller
- JavaFX Gradient Color
- JavaFXAnchorPane
- JavaFXTabPane
- JavaFX Scene
- JavaFX Stage
- JavaFXWebView
- JavaFX Timeline
- JavaFX Timer
- JavaFX Image
- JavaFX Background
- JavaFX dialog
- JavaFX Font
- JavaFXTextArea
- JavaFXObservableList
- JavaFX GUI
- JavaFX FXML
- JavaFXEventHandler
- JavaFXGradle
- JavafxScrollpane
- JavaFXAPI
JavaFX FXML
JavaFX FXML is defined as a GUI format with XML-based language launched by Oracle Corporation that enables to compose of the GUIs’ layout or the application of GUIs. The Primary purpose of FXML is to define a user interface. Placing XML mark-up here is to describe a component of UI in the hierarchy structure. A controller takes managing interactions by defining components and link them with them. FXML file has an extension .fxml and it is loaded by FXML Loader by JavaFX,
Syntax
JavaFX FXML is created as below
< ?xml version="1.0" encoding="UTF-8"?> < ?import javafx.scene.layout.VBox?> < ?import javafx.scene.control.Button?> < VBox> < children> < Button text="This is my official website on FXML"/> < /children> < /VBox>Features
- They have a large set of built-in GUI components like checkboxes; buttons also come with a built-in charts library to create charts.
- JavaFX FXML is an XML mark-up language and has a rich set of APIs. It’s a powerful tool and keeps the code easier. Used to develop rich Internet applications using java Files.
- JavaFX has CSS styling and gives a declarative layout through FXML.
- FXML uses namespaces with the prefix ‘fx’ in which all elements and attributes are assigned. Also, well simple to debug and modify.
JavaFX FXML work
JavaFX is used to create the Desktop Application, which allows to code the User-interface by making the application easier. In FXML XML elements are a class, script, property, static. A typical JavaFX FXML works like below:
- FXML document has a user interface of an FXML application.
- FXML Controller handles all the event handling process.
- Next, FXML Loader parses the given FXML document and creates a graph. Simultaneously the Main Class initiates the execution of a Program.
For example, when a user accessing a website, he/she checks with the updated information of their needs; therefore, we need to recompile a code. In such a case FXML controller plays a role.
Deploying the first JavaFx application is needed. To take up the process:
Setting Up a New Project by clicking the JavaFX FXML application. The IDE is sectored into three sections.
-
Java file:
This takes up a java code for an application (Main Application)
-
.fxml file:
Here FXML source file is created to define a user interface part.
-
java:
This part includes an event handling process like a mouse and keyboard clicks.
Examples
FXMLsample.java
package fxmlsample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class FXMLsample extends Application { @Override public void start(Stage st) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("FXMLdoc.fxml")); Scene sc = new Scene(root, 200, 215); st.setTitle("FXML Welcome"); st.setScene(sc); st.show(); } public static void main(String[] args) { launch(args); } }
A simple FXML file containing Grid Pane and text content and by default associated with controller class.
FXMLdoc.fxml
< ?xml version="1.0" encoding="UTF-8"?> < ?import java.net.*?> < ?import javafx.geometry.*?> < ?import javafx.scene.control.*?> < ?import javafx.scene.layout.*?> < ?import javafx.scene.text.*?> < Text text="Welcome Page" GridPane.columnIndex="0" GridPane.rowIndex="0" GridPane.columnSpan="3"/> < GridPanefx:controller="FXMLdoc.FXML_ctrl" xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="9" vgap="9"> < padding>< Insets top="22" right="22" bottom="12" left="22"/>< /padding> < /GridPane>
Next is the controller class with the response to the FXML file for the UI application
FXML_ctrl.java
packageFXMLsample; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.text.Text; import javafx.scene.control.Label; public class FXML_ctrl { @FXML private Text actiontarget; @FXML protected void handleSubmitButtonAction(ActionEvent event) { actiontarget.setText("Submit the button"); } }