go to previous page   go to home page   go to next page highlighting

Answer:

 
  public void start(Stage stage) 
  { 
    Group root = new Group( );   
    fillGroup( root, 0.9 );
    
    fillGroup( root, 0.8 );
    Scene scene = new Scene(root, sceneWidth, sceneHeight, Color.GHOSTWHITE ); 
    stage.setTitle("Two Calls to fillGroup"); 
    stage.setScene(scene); 
    stage.show(); 
  }      

} 

Scene Graph

Two nested rectangles, centered in the window

That was easy enough. Here is the scene graph that is built:


Scene graph with two rectangles

QUESTION 6:

Could a third and a fourth call to fillGroup() add even more rectangles to the scene graph?


go to previous page   go to home page   go to next page