I'll try to collect tips related to the UI elements in this thread.
In B4J (and JavaFX) the main UI element is named Node. It is similar to Basic4android View or Basic4ppc (.Net) Control.
B4J Pane is similar to B4A Panel. It is a node that contains other nodes. There are all kinds of Panes in JavaFX. The default one is AnchorPane.
AnchorPane allows you to "anchor" one or more of the node edges in relation to its parent.
You can set the anchor constraints in the code or with the builder:
If all 4 anchors are set then the node will increase or decrease its size together with the form.
Note that not all type of nodes can be resized automatically. ImageView and Canvas nodes will not be affected by these constraints. You will need to manually resize them. All the other types will resize automatically.
The Scene Builder is a powerful designer. You should use it as the main tool for building the layout.
See this tutorial: Working with JavaFX Scene Builder
There are some "generic" node types that you can use to hold other types (subclasses types).
For example a Node variable allows you to hold any type of node.
Pane allows you to hold any type of Pane.
Tooltips - You can add tooltips to all of the nodes:
You can also add context menus to most nodes (either with Scene Builder or in your code).
Nodes can be declared Public and accessed from other nodes. There are no restriction like in Basic4android.
Mouse events - Most nodes support the following mouse events: MouseClicked, MouseMoved, MouseDragged, MousePressed, MouseReleased.
The difference between MouseDragged and MouseMoved is that MouseDragged happens when one of the mouse buttons is pressed.
All of the events pass a MouseEvent object. This object holds more information about the event.
In B4J (and JavaFX) the main UI element is named Node. It is similar to Basic4android View or Basic4ppc (.Net) Control.
B4J Pane is similar to B4A Panel. It is a node that contains other nodes. There are all kinds of Panes in JavaFX. The default one is AnchorPane.
AnchorPane allows you to "anchor" one or more of the node edges in relation to its parent.
You can set the anchor constraints in the code or with the builder:
If all 4 anchors are set then the node will increase or decrease its size together with the form.
Note that not all type of nodes can be resized automatically. ImageView and Canvas nodes will not be affected by these constraints. You will need to manually resize them. All the other types will resize automatically.
The Scene Builder is a powerful designer. You should use it as the main tool for building the layout.
See this tutorial: Working with JavaFX Scene Builder
There are some "generic" node types that you can use to hold other types (subclasses types).
For example a Node variable allows you to hold any type of node.
Pane allows you to hold any type of Pane.
Tooltips - You can add tooltips to all of the nodes:
B4X:
btnCheckNow.TooltipText = "Click to check for new messages."
You can also add context menus to most nodes (either with Scene Builder or in your code).
Nodes can be declared Public and accessed from other nodes. There are no restriction like in Basic4android.
Mouse events - Most nodes support the following mouse events: MouseClicked, MouseMoved, MouseDragged, MousePressed, MouseReleased.
The difference between MouseDragged and MouseMoved is that MouseDragged happens when one of the mouse buttons is pressed.
All of the events pass a MouseEvent object. This object holds more information about the event.