root node in JavaFX的“point”是什么?

huangapple go评论71阅读模式
英文:

What is the "point" of root node in JavaFX?

问题

为什么 Scene 对象需要具有一个根节点?为什么 Scene 对象不能仅作为节点集合的占位符,而不将它们嵌套在根节点之下?

英文:

Why Scene object needs to have a root node? Why Scene object can't be just a placeholder for collection of nodes without them being nested under the root one?

答案1

得分: 4

"From Understanding the JavaFX Architecture

The JavaFX scene graph ... is a hierarchical tree of nodes that represents all of the visual elements of the application's user interface

A tree of nodes must have a single, root node.
Each node must have a parent node – except, of course, for the root node.

英文:

From Understanding the JavaFX Architecture<sup>1</sup>
> The JavaFX scene graph ... is a hierarchical tree of nodes that represents all of the visual elements of the application's user interface

A tree of nodes must have a single, root node.
Each node must have a parent node &ndash; except, of-course, for the root node.

<sup>1</sup> Part of Oracle's JavaFX tutorials.

huangapple
  • 本文由 发表于 2023年4月10日 21:12:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75977452.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定