13.7 BorderPane 2

Cliquez içi pour plus de vidéos disponibles sur notre chaine youtube !

Hello, In this video, we will do the 2nd part of the BorderPane. So now we have our three buttons at the bottom left.. So, one thing to mention here is that with nested layouts, what we did here we just moved our three buttons down through the "bottom" tag at the beginning they were on the top left. Then we have a nested layout our HBox is nested in the BorderPane. This is the concept of nested layouts by adding the hbox in the BorderPane, we nested the layout in another layout. When using BorderPane, nested layouts are the only means to add a row of buttons in the down position. We couldn’t have added each button individually in the lower position, and that’s because each position can only have one child. So what we’re going to do is add the alignment property to the HBox and not to the BorderPane because we saw that the alignment property does not exist for the BorderPane. So we’ll add it to the HBox, but this time we can put it on the top right, center right or bottom right. We’ll try top right. So in the HBox we’ll put "alignment = top_right" and we’ll also add a little padding. So we’ll put the padding beacon. And inside we’ll put insets. We will put the bottom is equal to 10 to say that we basically want a gap of 10 pixels at the bottom and 10 pixels at the right. So now we’re executing it and now it’s down on the right. You may be wondering why I put top right when the buttons are at the bottom right? Well, the thing to remember here, no matter what we use, the result will be the same. And it is of course because we have specified for the BorderPane that our HBox is inserted in the bottom part (bottom) of the layout. So let’s quickly try the three alignments just to confirm it. So we put it on the top right first now let’s try to put it on the center right. It’s the same results always. Now, if we go down to the right and we execute it. Again, it’s exactly the same result. It was for the 2nd part In the next video, we will finish the 3rd part Go ahead I tell you to the next!