- We watch a movie titled The Silence of the Lambs.
- It has an act of conversation between Hannibal Lecter and Clarice Starling. The act is in maximum security jail room.
- This room has a thick bullet proof partition glass, two chairs, a bed several sketch drawings. In this room we have 2 persons : Hannibal Lecter and Clarice Starling.
The movie is analogous to the Stage class. The conversation between Hannibal Lecter and Clarice Starling is analogous to Scene. Finally, things displayed in the scene are analogous to the Group that contains many scene objects int conversation scene.
Now we have an application that display the Hello World Text :
package javafxhelloworld;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
/**
*
* @author Joko Adianto
*/
public class JavaFXHelloWorld extends Application {
@Override
public void start(Stage primaryStage) {
Label label = new Label("Hello World");
Group group = new Group();
group.getChildren().add(label);
Scene scene = new Scene(group, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
The container Group holds another objects. In the example above it holds a Label. The object label contains a text value. getChildren().add(l...) is a statement for binding objects to a particular Group.

