Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 21 ■ Questions and answers: Finishing the setup Methods and digital audio

Remember that we have to add these Button objects to the SceneGraph hierarchy by adding your
qaLayout Node after the Q1 to Q4 Node objects and calling the getChildren().addAll() method chain with
the four Button objects as child objects to be added to the SceneGraph hierarchy. The Java statement is
shown highlighted in Figure 21-11.


Figure 21-10. Add four 350x100 Button UI objects at Y location -180, -60, 60, 180, labeled Answer One
through Answer Four


Figure 21-11. Add the four Button UI elements to the SceneGraph, using a qaLayout.getChildren().addAll()
method call

Free download pdf