Hello World GUI

This is an example of a basic JavaFX application.

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
 
Stage {
    title: "My JavaFX Application"
    scene: Scene {
        width: 300
        height: 200
        content: [
        	Text {
        		x:50  y:100
        		content: "Hello World"
        	}
        ]
    }  
}

The Stage object can be thought of as being the application window.
Within the Stage there is a Scene. This is the area in which all graphics will be rendered. This is where you can set the application's dimensions. Each Scene contains a JavaFX sequence named content. This variable contains all of the nodes which are to be rendered in the Scene. In this example the only element in the sequence is a Text node.

Hello World GUI outputHello World GUI output

Run the Applet