Java Reference
In-Depth Information
Figure 1.3
New JavaFX Project - Main.fx Editor Window
Create Main File checkbox checked when you created the project. Use this file
to create your simple first application. Figure 1.3 shows the editor window for
the Main.fx source file.
The Main.fx file will have skeleton code that displays a window with some text.
You need to modify this code. Like all good “Getting Started” chapters, let's do
the proverbial Hello World example. We'll cover the details later, but the code in
Listing 1.1 will show a window on the desktop, with “Hello World” displayed.
Listing 1.1
Simple Hello World Application
package myfirstjavafxapplication;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
Search WWH ::




Custom Search