A Tabbed”one is a component that appears as a group of folder sin a file cabinet. Each folder has a title. When a user selects ‘a folder, its contents become visible. Only one of the folders may be selected at a time. Tabbed panes arc commonly used for setting configuration options.
Tabbed panes are encapsulated b y the Deadpanned class, which extends J Component. We will use its default constructor. Tabs are defined via the following method: void add Tab(String Component comp)
Here, is the title for the tab, and comp is the component that should be added to, the tab. Typically, a JPanel or a subclass of it is added.
The general reduce to use a tabbed pane in an applet is outlined here:
1. Create a JTabbedPane object.
2. Call add’Tabt ) to add a tab to the pane. (The arguments to this method define
the title of the tab and the component it contains.)
3. Repeat step 2 (or each tab.
4. Add the tabbed pane to the content pane of the applet, The following example illustrates how to create a tabbed pane, The first tab is titled “Cities” and contains four buttons. Each button displays the name of a city. The second tab is titled “Colors” and contains three check boxes. Each check box displays the of a color. the third tab is titled “flavors” and contains one combo box. This enables the user to select one of three flavors.