22.9. Layout Managers: BoxLayout and GridBagLayout
In Chapter 11, we introduced three layout managers—FlowLayout, BorderLayout and GridLayout. This section presents two additional layout managers (summarized in Fig. 22.15). We discuss these layout managers in the examples that follow.
Layout manager | Description |
---|---|
BoxLayout | A layout manager that allows GUI components to be arranged left-toright or top-to-bottom in a container. Class Box declares a container with BoxLayout as its default layout manager and provides static methods to create a Box with a horizontal or vertical BoxLayout. |
GridBagLayout | A layout manager similar to GridLayout, but unlike it in that components can vary in size and can be added in any ... |
Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.