J2ME Polish
J2ME Polish 2.4 Documentation
Enough Software

Using TabbedPane

Design

TabbedPane
The above design has been realized with following settings in polish.css:

.tabbedPane {
	title-menu: true;
}

.tabbedPaneIcons {
	view-type: horizontal;
	background {
		type: vertical-gradient;
		top-color: #f6f6f6;
		bottom-color: #acadb1;
	}
	border {
		top-width: 1;
		color: #aaa;
	}
	layout: expand;
}

.tabIcon {
	margin: 1px;
	padding: 2px;
	icon-image: url( Tab%INDEX%.png );
	icon-image-align: top;
	max-width: 25%;
	font-bitmap: url( arialsmall.bmf );
	layout: expand | center | vertical-center;
}

.tabIcon:hover {
	padding: 1px;
	background {
		type: round-rect;
		arc: 8;
		color: #f1f1f1;
	}
	border {
		type: round-rect;
		arc: 8;
		color: #aeaeae;
	}
	icon-image: url( TabFoc%INDEX%.png );
}

The TabbedPane allows you to put several screens into a single TabbedPane. The user can jump between different tabs by clicking left and right. Title and commands are drawn from the currently selected screen.

The TabbedPane uses these default styles for its design:

  • .tabbedPaneIcons: the design of the bar that contains the tab icons

CSS Attributes for TabbedPane

You can use following TabbedPane specific CSS attributes for your design:

Programming

You can easily add screens to a TabbedPane using these methods:

  • TabbedPane(String title): Creates a new TabbedPane with the specified title - can be used with a style preprocessing directive..
  • addTab( Displayable tab, Image icon): Adds a screen.
  • addTab( Displayable tab, Image icon, String text): Adds a screen.
  • addTab( Displayable tab, IconItem iconItem): Adds a screen.
  • setTab(int index, Displayable tab): Changes the screen of the specified tab without changing the tab icon.
  • setTab(int index, Displayable tab, Image icon): Changes the screen of the specified tab.
  • setTab(int index, Displayable tab, Image icon, String text): Changes the screen of the specified tab.
  • setTab(int index, Displayable tab, IconItem tabIconItem): Changes the screen of the specified tab.
  • setCurrentTab( Displayable tab): Changes the screen of the currently selected tab.
  • setCurrentTab( Displayable tab, Image icon, String text): Changes the screen of the currently selected tab.
  • setCurrentTab( Displayable tab, Image icon, String text): Changes the screen of the currently selected tab.
  • setCurrentTab( Displayable tab, IconItem iconItem): Changes the screen of the currently selected tab.
  • setTabListener( TabListener tabListener): Sets a TabListener.
  • setTabbedFormListener( TabbedFormListener listener ): Sets the TabbedFormListener that is invoked before and after the user changes a tab.
  • setFocus(int tabIndex): Focuses the specified tab.
  • removeTab(int index): Removes the specified tab.
  • size(): Retrieves the number of tabs

Please refer to the "tabbedpane" sample application for working example.

JavaDoc

back to top