Site hosted by Angelfire.com: Build your free website today!
 

Intermediate Swing Containers

Swing provides several general-purpose intermediate containers:

Panel

Panels (JPanel) add almost no functionality beyond what all JComponent objects have.

  • the most flexible, frequently used intermediate container.

  • used to group components

  • can use any layout manager, and you can easily give it a border

  • content panes of top-level containers are often implemented as JPanel instances.

Scroll Pane

Provides scroll bars around a large or growable component.

Split Pane

Displays two components in a fixed amount of space, letting the user adjust the amount of space devoted to each component.

Tabbed Pane

Contains multiple components but shows only one at a time. The user can easily switch between components.

Tool Bar

Holds a group of components (usually buttons) in a row or column, optionally allowing the user to drag the tool bar into different locations.