Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Build a JavaFX Application Build a Pomodoro App Properties and Bindings

Luis Rodriguez
Luis Rodriguez
7,275 Points

<Children> Fxml

I am uncertain why the children fxml tag is there. What is it? and when should it be used?

<StackPane styleClass="nested-action,play"> <children> <HBox styleClass="svg-container"> <SVGPath styleClass="svg" content="M1.6 17C1 17 0 16.2 0 15.6V1.3C0 .1 2.2-.4 3.1.4l8.2 6.4c.5.4.8 1 .8 1.7 0 .6-.3 1.2-.8 1.7l-8.2 6.4c-.5.2-1 .4-1.5.4z"/> </HBox> <Button onAction="#handlePlay" text="Resume"/> </children> </StackPane>

here is a sample of code from the video. Hopefully I can get some help. Thanks.

1 Answer

Hello,

The <children> tag is used when there is a main element that contains other elements. The container is considered the 'parent', and the elements inside it the 'children'. Here it means that the HBox and the Button are inside the StackPane.

The HBox in turn could contain different things and therefore have a <children> tag of its own.

You can look at the documentation for more examples of where to use the <children> tag.