How do we build a TabbedPane component using AWT?

Scott Stanchfield

Swing provides a component called JTabbedPane that is rather good.

If you cannot (or don't want to) use Swing for some reason, there are several ways to do this.

The most common one is to create a custom Panel subclass that uses a CardLayout to display its children, and provide a set of buttons along an edge to switch between components. Other ways are more manual to track the components.

For an example (free with source code, for any use other than simply selling it) please see Scott Stanchfield's TabSplitter at http://www.javadude.com/tools/tabsplitter.