Registration Form Example Using JavaFX

This is a simplest form for JavaFX registration layout, you can modify it whatever based on your need.

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class App extends Application  {
    private StackPane root = new StackPane();
    private Stage stage;

    public void init() {
        Button button = new Button("OPEN");
        VBox vBox = new VBox();

        vBox.setPadding(new Insets(10,10,10,10));
                new Label("Your Name"),
                new TextField(),
                new Label("Your Username"),
                new TextField(),
                new Label("Your Password"),
                new PasswordField(),
                new Label("Confirm Password"),
                new PasswordField(),
                new Button("REGISTER"));

        button.setOnAction(actionEvent-> {
            stage = new Stage();
            StackPane stackPane = new StackPane();
            stage.setScene(new Scene(stackPane, 200,200));

    public void start(Stage primaryStage) {
        Scene scene = new Scene(root,400,600);
        primaryStage.setTitle("Registration Example JavaFX");

    public static void main(String[] args) {

JavaFX registration form example

Creating desktop application can be really hard, and the fact that there are three major desktop OS, Windows, MacOS and Linux, it can be time consuming to build three different code bases for three different OSes, but with the power of cross-platform Java, you can doing desktop development by just one single code base.

JavaFX is a great framework for your need to build desktop application, you can have the best development tools available and the maintainability of Java codes which is no questions you can build simple to large Application.

Popular posts from this blog

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

How To Connect SSH Using PEM Certificate On Windows

Intellij Error: Spring class file has wrong version 61.0, should be 55.0

MIME Types - Complete List

What Is My Localhost IP, For Windows User?