J2ME Polish
J2ME Polish 2.4 Documentation
Enough Software

Screen Titles

All screens support the setting of titles which are usually shown at the top of the screen.


You can design the title of all screen with the default title style:

colors {
	fontColor: #222;
	fontShadowColor: #eee;
	focusedFontColor: #111;
title {
	padding: 2;
	font-face: proportional;
	font-size: large;
	font-style: bold;
	font-color: focusedFontColor;
	background {
		type: vertical-gradient;
		top-color: #fff;
		bottom-color: #ccc;
		start: 2%;
		end: 90%;
	border: none;
	layout: horizontal-center | horizontal-expand;
	text-effect: shadow;
	text-shadow-color: fontShadowColor;

Note that the red status button in the above example is realized with a ScreenInfo element. Other options for embetting information within the title area include to use Item/CustomItem as your title, the usage of before/after attributes or of an image background.

Title specific design attributes:

CSS Attribute  DefaultValuesApplies To  Explanation
title-positiontoptop, bottomtitle style, screen style Positions the title at either the top or the bottom of the screen.
title-styletitle-screen style Sets a specific title style for the referenced screen:
.myAlert {
	title-style: myAlertTitle;
.myAlertTitle {
	background-color: red;
show-text-in-titlefalsefalse, truelist style Supresses the original title and uses the text of the currently selected element as the title within a list:
.mainMenuList {
	show-text-in-title: true;

Further design options:


You need to set the fullscreen-mode to either "menu" or "true" when J2ME Polish should render the title, otherwise the native title implementation of your target platform is used. You can set the fullscreen-mode within the <build> element of the <j2mepolish> task of your build.xml script:

<build usePolishGui="true" fullscreen="menu" > (...)


You can use any GUI item including your own CustomItem as a title by calling UiAccess.setTitle( Screen, Item ).

You can also set a subtitle located under the title by calling UiAccess.setSubTitle( Screen screen, String subTitle) or UiAccess.setSubTitle( Screen screen, Item subTitle).

You can hide the title as well as the menubar by calling screen.setFullScreenMode( true ); or UiAccess.setFullScreenMode( Screen, booolean ).

back to top