Back

TabPanel

TabPanel is a replacement for the java.awt.Panel class which can contain multiple panels. A row of "tabs" along the top of the panel allows the user to select which panel to view. Usage is extremely simple: add to the TabPanel java.awt.Panel instances with an accompanying String name. Add the TabPanel to your layout. The user can then select the added panels by clicking on the tabs.

This class was adapted from a class named FolderTabPanel, written by Pete Yared of JRad Technologies, pulled off of Usenet during a DejaNews search. I liked the look of the class but not the operation. So I modified it to JDK 1.1 specs and implemented the CardLayout layout manager for displaying of panels. Full change description is in the source file.

Sorry, no test applet as most browsers wouldn't show it correctly anyways, being a 1.1 class. It really is very easy to use though and looks quite nice! The example picture above is taken from Percolator's options dialog. Each tabbed panel is a BevelPanel and the TabPanel itself is layed out as the "Center" component of a BorderLayout, with a Panel of Button's in the "South" layout position.

The Source

TabPanel.java


Home Mail Since 08/22/97: Counter

Last modified: Fri Aug 22 14:59:19 PDT 1997