6.6.2. Tabbed Panes
Tabbed panes are a familiar user interface device to break up a complex dialog box into subsets of related options. You can also use tabs to let a user flip through a set of documents or images (see Figure 6.45). That is what we do in our sample program.
To create a tabbed pane, first construct a
JTabbedPane object, then add tabs to it.
JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(title, icon, component);
The last parameter of the
addTab method has type
Component. To add multiple components into the same tab, first pack them up in a container, such as a
The icon is optional; ...