FileDocCategorySizeDatePackage
About.javaAPI DocJ2ME MIDP 2.02521Thu Nov 07 12:02:14 GMT 2002example

About

public class About extends Object
Typical about box with a string and an image. In this case the Sun copyright and logo.

Fields Summary
private static String
copyright
Copyright notice
private Displayable
previous
the previous screen to go back to
Constructors Summary
private About()
Do not allow anyone to create this class


                 
      
Methods Summary
public static voidshowAbout(Display display)
Put up the About box and when the user click ok return to the previous screen.

param
display The Display to return to when the about screen is dismissed.


	Alert alert = new Alert("About MIDP");
	alert.setTimeout(Alert.FOREVER);

	if (display.numColors() > 2) {
	    String icon = (display.isColor()) ?
		"/icons/JavaPowered-8.png" : "/icons/JavaPowered-2.png";

	    try {
	        Image image = Image.createImage(icon);
		alert.setImage(image);
	    } catch (java.io.IOException x) {
		// just don't append the image.
	    }
	}
	// Add the copyright
	alert.setString(copyright);

	display.setCurrent(alert);