免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Advanced layouts
- [Instructor] More Layout Managers. The swing packages include a general purpose layout manager named box layout, as well as a second layout called card layout. The box layout stacks components, where the card layout allows us to manage multiple components that share the same display space. Let's start by taking a look at the box layout. The box layout arranges components either vertically or horizontally. Although the box layout is not an option in the UI designer view of IntelliJ. As we can see here, if I click on LayoutManager, we don't see box layout. But that's okay, we can set it in our code. You might think of the box layout as a version of the flow layout, but with greater flexibility. Let's launch our box layout example, and then we'll go over the code in a little more detail. So I already have it set up here in the main, to run the box layout. I'm going to go ahead and run that. And we'll see that. Actually, let me make the window a little bigger. The values are added left…