From 23614b84eddd67cfdcb2f43e6452f18d727e2bf5 Mon Sep 17 00:00:00 2001 From: laney0808 Date: Wed, 25 Sep 2024 14:52:03 +0800 Subject: [PATCH 1/2] Add explanation to Part 1 introduction --- tutorials/javaFxPart1.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tutorials/javaFxPart1.md b/tutorials/javaFxPart1.md index 61a3eb76..15d14521 100644 --- a/tutorials/javaFxPart1.md +++ b/tutorials/javaFxPart1.md @@ -15,6 +15,13 @@ Imagine yourself as a director of a play. First you provision the props that you A JavaFX application is like a play you are directing. Instead of creating props, you create `Node`s (`Node`s are the fundamental building blocks of a JavaFX application), and place them onto a `Scene` (a scene is a graph of `Node`s). Then, you set your `Scene` on a `Stage` provided by JavaFX. When you call `Stage#show()` method, JavaFX renders a window with your `Stage` on it. + +The `Stage` is like a window in a desktop application. It is the top-level container for a JavaFX application. +A `Scene` is a container for `Node`s. +A `Node` is a component that can be added to a `Scene`. `Node`s can be simple controls like `Label`, `Button`, etc., or complex controls like `TableView`, `TreeView`, etc. +A `Root Node` is the topmost `Node` in a `Scene`, the parent of all other `Node`s. It is usually a pane like `StackPane`, `BorderPane`, etc. + + Well, that's a very high-level view of how JavaFX works. The actual implementation of a Java FX is a bit more (ahem...) "involved". This tutorial takes you through the steps of building a typical Java FX application, using a chatbot application called Duke as a running example. Given below is what the end result can look like if you follow this tutorial until the end: