Step: 1


Step: 3 Absolute path lib

Step: 4 Click To Finish

Step: Analysis

Project Explorer

Code created :

main : loader: JavaFXMLTemplate1.java

package javafxmltemplate1;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

* @author Manas9
public class JavaFXMLTemplate1 extends Application {

public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument1.fxml"));
Scene scene = new Scene(root);
stage.setTitle("FXML::AnchorPane, Button, Label");

* @param args the command line arguments
public static void main(String[] args) {


Code fxml :: JavaFXMLDocument1.fxml

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml/1" fx:controller="javafxmltemplate1.FXMLDocument1Controller">
<Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" />
<Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" />

Code controller:: JavaFXMLDocument1Controller.java

-------------class FXMLDocument1Controller----------------------------
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
package javafxmltemplate1;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;

* @author Manas9
public class FXMLDocument1Controller implements Initializable {

private Label label;

private void handleButtonAction(ActionEvent event) {
System.out.println("You clicked me!");
label.setText("Hello World!");

public void initialize(URL url, ResourceBundle rb) {