Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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.