03-10-2010 01:51 AM
The Canvas class is specific to the MIDlet MIDP framework. For menus, take a look at the Command class.
You can develop for the BlackBerry using the MIDlet MIDP framework or using the BlackBerry CLDC framework. You cannot mix the two frameworks in a single application. The BlackBerry framework provides more features, but is specific to BlackBerry devices. A MIDlet application will be easier to port to other devices. Most BlackBerry developers choose to use the BlackBerry framework.
For the BlackBerry framework, the equivalent to a Canvas is to write your own custom subclass of the Field class and add it to a MainScreen. Then take a look at the methods getContextMenu() and (for the screen) makeMenu().
For more information on MIDlet development, read the BlackBerry MIDlet Developer Guide.
For more information on BlackBerry development read the BlackBerry Development Guides, especially the Fundamentals Guide and the Getting Started Guide. (Be sure to select the 4.7 version of the documents.)
03-10-2010 02:21 AM
what i understand from your reply is that i have to devlop one class which extends Field class of blackberry API.
Can i use paint method in that class for developing UI part?
In J2me we use canvas's paint method for developing the UI part.
03-10-2010 02:52 AM
Yes, You may override the paint method for the Field class. There are various derived classes too like MainScreen, PopupScreen, etc that provide different layout options/components. You may check and use as per your requirement.
If you only need a plain canvas, then Field class is the one you need.
03-10-2010 02:58 AM - edited 03-10-2010 03:11 AM
I will try with plain canvas.
I have created one class which will extend Field
& in that class i have override the paint method in that methd i am trying to disply the text.
but it is not displying only blank screen is displaying.
I hvae added this subclass in the MainScreen object & i displyed that mainscreen objecct.
Is it the rigjht way??
03-10-2010 03:10 AM
After reading the API documentation for Field, I'd suggest doing a Google search for examples, using some or all of these terms:
blackberry custom field example tutorial game
You should be able to find several good step-by-step tutorials.