JavaFX-2: What is the difference between a Scene and a Pane
javafx-2
Solution
what functionality does the Scene provide?
Why don't you just compare the Javadoc of both?
E.g.
- Scene is not a Node
- Scene has a camera and a window property
- ...
So you have only one Scene per Stage but possibly several Panes (a Pane is-a Node).
The Scene is the start of, well, the scence graph. But it is more light-weight than a Stage/ Windows, AFAIK.
Problem
I'm trying to understand (in general terms) the difference between a javafx 2 Scene and Pane. I can get them to work, but I haven't found a clear explanation of what functionality each provides. The javadoc api defines a Scene as "the container for all content in a scene graph". A Pane (subclass of Region, Parent, Node) is also a container (since widgets like Button) get added to it, rather than to Scene. Apparently Pane handles layout and Scene does not. Or to put it another way: widgets get added to Panes, a Pane is attached to a Scene, and a Scene is attached to the top level container, Stage. Since Pane does layout and can have properties set such as size, css style, etc., what functionality does the Scene provide? It does appear to be required. Thanks