How to draw gradients with J2ME

Gradients are a nice graphic element to be used within your game or application. But, wouldn’t it be great if you could use all the gradients you want, without using images?

And here is the Saturday Tutorial :)

Draw gradients with J2me

The gradients shown in the screenshot above are generated by the following straightforward method:

Gradient.gradientBox(Graphics g, 
	int color1, int color2, 
	int left, int top, 
	int width, int height, 
	int orientation)

For the full source code you can see the J2me Gradient tutorial on Forum Nokia Wiki

Be Sociable, Share!